Show / Hide Table of Contents

    Method ToLocalDateTime

    ToLocalDateTime(DateTimeOffset, ClaimsPrincipal)

    Returns a new DateTime instance based on the current DateTimeOffset instance that represents the local time for a given ClaimsPrincipal's time zone.
    Declaration
    public static DateTime ToLocalDateTime(this DateTimeOffset dateTimeOffset, ClaimsPrincipal principal)
    Parameters
    Type Name Description
    DateTimeOffset dateTimeOffset The DateTimeOffset instance to convert.
    ClaimsPrincipal principal The ClaimsPrincipal instance whose TimeZone claim determines the time zone of the result. The time zone used equals the time zone returned by GetTimeZone(ClaimsPrincipal).
    Returns
    Type Description
    DateTime A new DateTime instance that represents the date and time of the current DateTimeOffset instance converted to the time zone of the principal with fallback to the local time of the system.

    ToLocalDateTime(Nullable<DateTimeOffset>, ClaimsPrincipal)

    Returns a new System.Nullable<> instance based on the current System.Nullable<> instance that represents the local time for a given ClaimsPrincipal's time zone.
    Declaration
    public static Nullable<DateTime> ToLocalDateTime(this Nullable<DateTimeOffset> dateTimeOffset, ClaimsPrincipal principal)
    Parameters
    Type Name Description
    System.Nullable<DateTimeOffset> dateTimeOffset The System.Nullable<> instance to convert.
    ClaimsPrincipal principal The ClaimsPrincipal instance whose TimeZone claim determines the time zone of the result. The time zone used equals the time zone returned by GetTimeZone(ClaimsPrincipal).
    Returns
    Type Description
    System.Nullable<DateTime> A new System.Nullable<> instance that represents the date and time of the current System.Nullable<> instance converted to the time zone of the principal with fallback to the local time of the system.
    Back to top Copyright © 2017-2018, xplo.re IT Services, Michael Maier. All rights reserved.