<PackageReference Include="Relativity.Server.Utility.SDK" Version="5000.0.0" />

DateTime

public class DateTime
Provides static utility methods for manipulating instances of DateTime.
public class DateTimeValidator

Provides static method to validate date strings.

public class StringConverter

Provides methods for converting dates to strings.

public DateTime()

public static string FormatDateStoredAsString(string potentialDate, bool toLocal)

Formats the provided string representation of a date, optionally converting it to local time.

public static string FormatElapsedTime(DateTime beginDateTime, DateTime endDateTime)

Gets a formatted string of the time elapsed between the two provided dates. String format: "HH:MM:SS"

public static DateTime[] GetDateRange(string rangeDescriptor, bool useUtc)

Gets a date from the provided range description, optionally in UTC time.

public static DateTime[] GetDateRange(string rangeDescriptor, DateTime nowValue)

Gets a date from the provided range description and date.

public static string GetMonthName(int month)

Gets the month name associated with the specified index.

public static bool IsDateTime(object value)

Indicates whether or not the the provided object is a date in the current culture.

public static bool IsDateTime(object value, CultureInfo culture)

Indicates whether or not the the provided object is a date in the specified culture.

public static DateTime Max(DateTime firstDate, DateTime secondDate)

Returns the larger of the two provided dates.

public static DateTime Min(DateTime firstDate, DateTime secondDate)

Returns the smaller of the two provided dates.

public static int MonthDifference(DateTime firstDate, DateTime secondDate)

Gets the number of months between the first and second date, inclusive.

E.g. June 2005 compared against July 2006 = 14 months difference.

public static int MonthOverlap(DateTime startDateOne, DateTime endDateOne, DateTime startDateTwo, DateTime endDateTwo)

Calculates the number of months, inclusive, between the later starting date and the earlier ending date.

E.g. 'May 2015 - December 2015' and 'July 2015 - February 2016' -> 6 months overlap.

public static DateTime ParseSqlCultureNeutralString(string s)

Parses a culture-neutral sql-formatted string into a date, no globalization.

public static DateTime ParseSqlCultureNeutralString(string s, DateTimeStyles dateTimeStyles)

Parses a culture-neutral sql-formatted string into a date, with globalization.

public static DateTime ParseSqlCultureNeutralString(string s, bool toLocalTime)

Parses a culture-neutral sql-formatted string into a date, optionally converted to local time.

public static string ToDotNetCultureNeutralString(DateTime d)

Gets the culture-neutral .net-formatted string representation of the provided date.

public static string ToSqlCultureNeutralString(DateTime d)

Gets the culture-neutral sql-formatted string representation of the provided date.

public static int YearDifference(DateTime firstDate, DateTime secondDate)

Gets the number of years between the first and second date, inclusive.

E.g. June 2005 compared against July 2006 = 2 years difference.