src/Azos/Time/DefaultTimeSource.cs
/// <summary>
/// Converts universal time to local time as of TimeLocation property
/// </summary>
Converts universal time to local time as of TimeLocation property
Converts universal time to local time as of TimeLocation property
public DateTime UniversalTimeToLocalizedTime(DateTime utc)
        {
            if (utc.Kind!=DateTimeKind.Utc)
              throw new TimeException(StringConsts.ARGUMENT_ERROR+GetType().Name+".UniversalTimeToLocalizedTime(utc.Kind!=UTC)");
            var loc = TimeLocation;
            if (!loc.UseParentSetting)
            {
                return DateTime.SpecifyKind(utc + loc.UTCOffset, DateTimeKind.Local);
            }
            else
            {
                return utc.ToLocalTime();
            }
        }
public DateTime UniversalTimeToLocalizedTime ( DateTime utc ) { if ( utc . Kind != DateTimeKind . Utc ) throw new TimeException ( StringConsts . ARGUMENT_ERROR + GetType ( ) . Name + " " ) ; var loc = TimeLocation ; if ( ! loc . UseParentSetting ) { return DateTime . SpecifyKind ( utc + loc . UTCOffset , DateTimeKind . Local ) ; } else { return utc . ToLocalTime ( ) ; } }
Converts universal time to local time as of TimeLocation property
Converts universal time to local time as of TimeLocation property
utc
DateTime