Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Utility Namespace / LocaleHelper Class / ToLocalTime Method / ToLocalTime(DateTime,Double) Method
The time in utc. The datetime value is assumed to be in utc, regardless of the value of the "Kind" property.
The offset to use in calculating the local date.
In This Topic
    ToLocalTime(DateTime,Double) Method
    In This Topic
    Converts a utc time to local time, based on the provided offset.
    Syntax
    public static DateTime ToLocalTime( 
       DateTime utc,
       double offset
    )

    Parameters

    utc
    The time in utc. The datetime value is assumed to be in utc, regardless of the value of the "Kind" property.
    offset
    The offset to use in calculating the local date.

    Return Value

    A datetime instance with the time adjusted to local time for the offset specified.
    Remarks
    If local is DateTime.MinValue, or if local.Kind is DateTimeKind.Local, local is returned unaltered.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also