You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

DateTimeUtils.cs 479 B

1234567891011121314
  1. using System;
  2. namespace Discord
  3. {
  4. //Source: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/DateTimeOffset.cs
  5. internal static class DateTimeUtils
  6. {
  7. public static DateTimeOffset FromTicks(long ticks)
  8. => new DateTimeOffset(ticks, TimeSpan.Zero);
  9. public static DateTimeOffset? FromTicks(long? ticks)
  10. => ticks != null ? new DateTimeOffset(ticks.Value, TimeSpan.Zero) : (DateTimeOffset?)null;
  11. }
  12. }