Class DateTimeUtils
Inheritance
System.Object
DateTimeUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Bayat.Json.Runtime.dll
Syntax
public static class DateTimeUtils
Fields
|
Improve this Doc
View Source
InitialJavaScriptDateTicks
Declaration
public static readonly long InitialJavaScriptDateTicks
Field Value
Type |
Description |
System.Int64 |
|
Methods
|
Improve this Doc
View Source
ConvertDateTimeToJavaScriptTicks(DateTime)
Declaration
public static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime)
Parameters
Type |
Name |
Description |
System.DateTime |
dateTime |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
ConvertDateTimeToJavaScriptTicks(DateTime, Boolean)
Declaration
public static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, bool convertToUtc)
Parameters
Type |
Name |
Description |
System.DateTime |
dateTime |
|
System.Boolean |
convertToUtc |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
ConvertDateTimeToJavaScriptTicks(DateTime, TimeSpan)
Declaration
public static long ConvertDateTimeToJavaScriptTicks(DateTime dateTime, TimeSpan offset)
Parameters
Type |
Name |
Description |
System.DateTime |
dateTime |
|
System.TimeSpan |
offset |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
ConvertJavaScriptTicksToDateTime(Int64)
Declaration
public static DateTime ConvertJavaScriptTicksToDateTime(long javaScriptTicks)
Parameters
Type |
Name |
Description |
System.Int64 |
javaScriptTicks |
|
Returns
Type |
Description |
System.DateTime |
|
|
Improve this Doc
View Source
CreateDateTime(DateTimeParser)
Declaration
public static DateTime CreateDateTime(DateTimeParser dateTimeParser)
Parameters
Returns
Type |
Description |
System.DateTime |
|
|
Improve this Doc
View Source
EnsureDateTime(DateTime, DateTimeZoneHandling)
Declaration
public static DateTime EnsureDateTime(DateTime value, DateTimeZoneHandling timeZone)
Parameters
Returns
Type |
Description |
System.DateTime |
|
|
Improve this Doc
View Source
GetUtcOffset(DateTime)
Declaration
public static TimeSpan GetUtcOffset(this DateTime d)
Parameters
Type |
Name |
Description |
System.DateTime |
d |
|
Returns
Type |
Description |
System.TimeSpan |
|
|
Improve this Doc
View Source
ToSerializationMode(DateTimeKind)
Declaration
public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind)
Parameters
Type |
Name |
Description |
System.DateTimeKind |
kind |
|
Returns
Type |
Description |
System.Xml.XmlDateTimeSerializationMode |
|
|
Improve this Doc
View Source
TryParseDateTime(StringReference, DateTimeZoneHandling, String, CultureInfo, out DateTime)
Declaration
public static bool TryParseDateTime(StringReference s, DateTimeZoneHandling dateTimeZoneHandling, string dateFormatString, CultureInfo culture, out DateTime dt)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryParseDateTime(String, DateTimeZoneHandling, String, CultureInfo, out DateTime)
Declaration
public static bool TryParseDateTime(string s, DateTimeZoneHandling dateTimeZoneHandling, string dateFormatString, CultureInfo culture, out DateTime dt)
Parameters
Type |
Name |
Description |
System.String |
s |
|
DateTimeZoneHandling |
dateTimeZoneHandling |
|
System.String |
dateFormatString |
|
System.Globalization.CultureInfo |
culture |
|
System.DateTime |
dt |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryParseDateTimeIso(StringReference, DateTimeZoneHandling, out DateTime)
Declaration
public static bool TryParseDateTimeIso(StringReference text, DateTimeZoneHandling dateTimeZoneHandling, out DateTime dt)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryParseDateTimeOffset(StringReference, String, CultureInfo, out DateTimeOffset)
Declaration
public static bool TryParseDateTimeOffset(StringReference s, string dateFormatString, CultureInfo culture, out DateTimeOffset dt)
Parameters
Type |
Name |
Description |
StringReference |
s |
|
System.String |
dateFormatString |
|
System.Globalization.CultureInfo |
culture |
|
System.DateTimeOffset |
dt |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryParseDateTimeOffset(String, String, CultureInfo, out DateTimeOffset)
Declaration
public static bool TryParseDateTimeOffset(string s, string dateFormatString, CultureInfo culture, out DateTimeOffset dt)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.String |
dateFormatString |
|
System.Globalization.CultureInfo |
culture |
|
System.DateTimeOffset |
dt |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryParseDateTimeOffsetIso(StringReference, out DateTimeOffset)
Declaration
public static bool TryParseDateTimeOffsetIso(StringReference text, out DateTimeOffset dt)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public static int WriteDateTimeOffset(char[] chars, int start, TimeSpan offset, DateFormatHandling format)
Parameters
Type |
Name |
Description |
System.Char[] |
chars |
|
System.Int32 |
start |
|
System.TimeSpan |
offset |
|
DateFormatHandling |
format |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
WriteDateTimeOffsetString(TextWriter, DateTimeOffset, DateFormatHandling, String, CultureInfo)
Declaration
public static void WriteDateTimeOffsetString(TextWriter writer, DateTimeOffset value, DateFormatHandling format, string formatString, CultureInfo culture)
Parameters
Type |
Name |
Description |
System.IO.TextWriter |
writer |
|
System.DateTimeOffset |
value |
|
DateFormatHandling |
format |
|
System.String |
formatString |
|
System.Globalization.CultureInfo |
culture |
|
|
Improve this Doc
View Source
Declaration
public static int WriteDateTimeString(char[] chars, int start, DateTime value, TimeSpan? offset, DateTimeKind kind, DateFormatHandling format)
Parameters
Type |
Name |
Description |
System.Char[] |
chars |
|
System.Int32 |
start |
|
System.DateTime |
value |
|
System.Nullable<System.TimeSpan> |
offset |
|
System.DateTimeKind |
kind |
|
DateFormatHandling |
format |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
WriteDateTimeString(TextWriter, DateTime, DateFormatHandling, String, CultureInfo)
Declaration
public static void WriteDateTimeString(TextWriter writer, DateTime value, DateFormatHandling format, string formatString, CultureInfo culture)
Parameters
Type |
Name |
Description |
System.IO.TextWriter |
writer |
|
System.DateTime |
value |
|
DateFormatHandling |
format |
|
System.String |
formatString |
|
System.Globalization.CultureInfo |
culture |
|
|
Improve this Doc
View Source
WriteDefaultIsoDate(Char[], Int32, DateTime)
Declaration
public static int WriteDefaultIsoDate(char[] chars, int start, DateTime dt)
Parameters
Type |
Name |
Description |
System.Char[] |
chars |
|
System.Int32 |
start |
|
System.DateTime |
dt |
|
Returns
Type |
Description |
System.Int32 |
|