public static GetDefaultTimezoneInfo ( ) : |
||
return |
/// <summary> /// Convert date to an especific timezone /// </summary> /// <param name="date">date to convert</param> /// <param name="destinationTimeZoneName">destination date timezone name</param> /// <returns>date on especific timezone</returns> public static DateTime ToTimezoneDate(this DateTime date, string destinationTimeZoneName) { var destinationTimezone = BaseDateTimeExtensions.GetTimezoneInfo(destinationTimeZoneName); return(date.ToTimezoneDate(BaseDateTimeExtensions.GetDefaultTimezoneInfo(), destinationTimezone)); }
/// <summary> /// Convert date to unix timestamp /// </summary> /// <param name="date">date to convert</param> /// <returns>unix timestamp</returns> public static long ToUnixTimestamp(this DateTime date) { var timezoneInfo = BaseDateTimeExtensions.GetDefaultTimezoneInfo(); return(date.ToUnixTimestamp(timezoneInfo)); }
/// <summary> /// Convert date to an especific timezone /// </summary> /// <param name="date">date to convert</param> /// <param name="destinationTimeZoneInfo">destination date timezone info</param> /// <returns>date on especific timezone</returns> public static DateTime ToTimezoneDate(this DateTime date, TimeZoneInfo destinationTimeZoneInfo) { return(date.ToTimezoneDate(BaseDateTimeExtensions.GetDefaultTimezoneInfo(), destinationTimeZoneInfo)); }
/// <summary> /// Convert date to UtcDate /// </summary> /// <param name="date">date to convert</param> /// <returns>utc date</returns> public static DateTime ToUtc(this DateTime date) { var timezoneInfo = BaseDateTimeExtensions.GetDefaultTimezoneInfo(); return(date.ToUtc(timezoneInfo)); }