ToLocalTime() public static méthode

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.
Résultat System.DateTime
Exemple #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()));
 }
        /// <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));
        }