Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dateTime">The date to convert.</param>
 /// <param name="formate">The formate of date to convert.</param>
 /// <returns></returns>
 public static string ToDateString(this DateTime dateTime, EnumCommonology.DateTimeForamte formate)
 {
     return(dateTime.ToString(formate.GetAttribute <DateAttribute>()?.Value));
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dateTime">The UTC date to convert.</param>
 /// <param name="timeZoneId">The time zone to convert date to.</param>
 /// <param name="formate">The formate of date to convert.</param>
 /// <returns></returns>
 public static string ToLocalDateString(this DateTime dateTime, string timeZoneId, EnumCommonology.DateTimeForamte formate)
 {
     return(dateTime.ToLocalDateTime(timeZoneId).ToString(formate.GetAttribute <DateAttribute>()?.Value));
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dateTime">The date to convert.</param>
 /// <param name="formate">The formate of date to convert.</param>
 /// <returns></returns>
 public static string ToDateString(this DateTime?dateTime, EnumCommonology.DateTimeForamte formate)
 {
     return(dateTime.HasValue ? dateTime.Value.ToDateString(formate) : string.Empty);
 }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dateTime">The UTC date to convert.</param>
 /// <param name="timeZoneId">The time zone to convert date to.</param>
 /// <param name="formate">The formate of date to convert.</param>
 /// <returns></returns>
 public static string ToLocalDateString(this DateTime?dateTime, string timeZoneId, EnumCommonology.DateTimeForamte formate)
 {
     return(dateTime.HasValue ? dateTime.Value.ToLocalDateString(timeZoneId, formate) : string.Empty);
 }