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
    System.Object
    DateTimeUtilities
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.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
    System.DateTime dt

    The date to normalize

    Returns
    Type Description
    System.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 System.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
    System.String s

    The input string

    System.DateTime result

    If the method returns true, holds the System.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
    System.Boolean

    true if a parse was successful, and false otherwise.

    On this page

    Back to top Generated by DocFX