Search Results for

    Show / Hide Table of Contents

    Class DateTimeUtilities

    Utilities for date and time manipulation.

    This class is intended for internal use and should not be used directly in third-party appliations.

    Inheritance
    object
    DateTimeUtilities
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.Core
    Assembly: Sdl.LanguagePlatform.Core.dll
    Syntax
    public static class DateTimeUtilities

    Methods

    Normalize(DateTime)

    Normalizes the date to UTC, unless dt's date is already specified in UTC.

    Declaration
    public static DateTime Normalize(DateTime dt)
    Parameters
    Type Name Description
    DateTime dt

    The date to normalize

    Returns
    Type Description
    DateTime

    The UTC-normalized date, or the identical value if the date is already in UTC.

    TryParseWithFallback(string, out DateTime)

    Attempts to parse the specified string into a DateTime object. First, System.DateTime.TryParse is used to attempt a parse in the universal format. If that fails, a parse is attempted using the current local date/time format.

    Declaration
    public static bool TryParseWithFallback(string s, out DateTime result)
    Parameters
    Type Name Description
    string s

    The input string

    DateTime result

    If the method returns true, holds the DateTime value of the successful parse, adjusted to Universal time. If the method returns false, the value is undefined and should not be used.

    Returns
    Type Description
    bool

    true if a parse was successful, and false otherwise.

    In this article
    • Methods
      • Normalize(DateTime)
      • TryParseWithFallback(string, out DateTime)
    Back to top Generated by DocFX