ToLocalTime() 공개 정적인 메소드

Converts a DateTime to local time (with special handling for MinValue and MaxValue).
public static ToLocalTime ( System.DateTime dateTime ) : System.DateTime
dateTime System.DateTime A DateTime.
리턴 System.DateTime
예제 #1
0
 /// <summary>
 /// Converts this BsonValue to a DateTime in local time.
 /// </summary>
 /// <returns>A DateTime.</returns>
 public override DateTime ToLocalTime()
 {
     return(BsonUtils.ToLocalTime(ToUniversalTime()));
 }
예제 #2
0
        /// <summary>
        /// Converts the BsonDateTime value to a .NET DateTime value in the local timezone.
        /// </summary>
        /// <returns>A DateTime in the local timezone.</returns>
        public DateTime ToLocalTime()
        {
            var utcDateTime = BsonUtils.ToDateTimeFromMillisecondsSinceEpoch(_millisecondsSinceEpoch);

            return(BsonUtils.ToLocalTime(utcDateTime, DateTimeKind.Local));
        }