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
Inherited Members
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 |
Returns
Type | Description |
---|---|
System.Boolean |
|