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.
Inherited Members
Namespace: SdlSdl.LanguagePlatformCore
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 |
Returns
Type | Description |
---|---|
bool |
|