-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WeChatPay.V3] 新增 ToRfc3339FormatString
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Essensoft.Paylink.WeChatPay/V3/Extensions/DateTimeExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
|
||
namespace Essensoft.Paylink.WeChatPay.V3.Extensions; | ||
|
||
public static class DateTimeExtensions | ||
{ | ||
/// <summary> | ||
/// 示例值:2018-06-08T10:34:56+08:00 | ||
/// </summary> | ||
private const string Rfc3339Format = "yyyy-MM-ddTHH:mm:ssK"; | ||
|
||
public static string ToRfc3339FormatString(this DateTime dateTime) | ||
{ | ||
return dateTime.ToString(Rfc3339Format); | ||
} | ||
} |