Example #1
0
 /// <summary>
 /// Returns an instance of <see cref="DateTimeOffset"/> based on the amount of seconds since the start of the
 /// Unix epoch - that is <c>1st of January, 1970 - 00:00:00 GMT</c>.
 /// </summary>
 /// <param name="timestamp">The Unix timestamp specified in seconds.</param>
 /// <returns>The timestamp as an instance of <see cref="DateTimeOffset"/>.</returns>
 public static DateTimeOffset GetDateTimeOffsetFromUnixTime(long timestamp)
 {
     return(TimeUtils.GetDateTimeOffsetFromUnixTime(timestamp));
 }
Example #2
0
 /// <summary>
 /// Initialize a new instance from the specified UNIX timestamp.
 /// </summary>
 /// <param name="timestamp">The UNIX timestamp specified in seconds.</param>
 /// <returns>An instance of <see cref="EssentialsDateTime"/>.</returns>
 public static EssentialsTime FromUnixTimestamp(double timestamp)
 {
     return(new EssentialsTime(TimeUtils.GetDateTimeOffsetFromUnixTime(timestamp)));
 }