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