Skip to content

Commit

Permalink
Mark DateTimeExtensions methods as obsolete
Browse files Browse the repository at this point in the history
Fixes #40
  • Loading branch information
0xced authored and damianh committed Nov 19, 2024
1 parent 777f4e8 commit 7c46558
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions identity-model/src/IdentityModel/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static class DateTimeExtensions
/// <summary>
/// Converts the given date value to epoch time.
/// </summary>
[Obsolete("Please use DateTimeOffset.ToUnixTimeSeconds() instead.")]
public static long ToEpochTime(this DateTime dateTime)
{
var date = dateTime.ToUniversalTime();
Expand All @@ -22,6 +23,7 @@ public static long ToEpochTime(this DateTime dateTime)
/// <summary>
/// Converts the given epoch time to a <see cref="DateTime"/> with <see cref="DateTimeKind.Utc"/> kind.
/// </summary>
[Obsolete("Please use DateTimeOffset.FromUnixTimeSeconds() instead.")]
public static DateTime ToDateTimeFromEpoch(this long date)
{
var timeInTicks = date * TimeSpan.TicksPerSecond;
Expand Down

0 comments on commit 7c46558

Please sign in to comment.