Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Utility Namespace / LocaleHelper Class / ToLocalTime Method / ToLocalTime(DateTime) Method
The time in utc. The datetime value is assumed to be in utc, regardless of the value of the "Kind" property.
In This Topic
    ToLocalTime(DateTime) Method
    In This Topic
    Converts a utc time to local time, using the offset configured in the store settings.
    Syntax
    public static DateTime ToLocalTime( 
       DateTime utc
    )

    Parameters

    utc
    The time in utc. The datetime value is assumed to be in utc, regardless of the value of the "Kind" property.

    Return Value

    A datetime instance with the time adjusted to local time.
    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