Show / Hide Table of Contents

Class DateTimeExtensions

Defines a static class containing extension methods for the System.DateTime structure.

Inheritance
System.Object
DateTimeExtensions
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()
Namespace: Juhta.Net.Extensions
Assembly: Juhta.Net.dll
Syntax
public static class DateTimeExtensions

Methods

| Improve this Doc View Source

ToDigitTimestamp(DateTime)

Converts the value of the current DateTime instance to an equivalent 21-digit timestamp.

Declaration
public static string ToDigitTimestamp(this DateTime dateTime)
Parameters
Type Name Description
System.DateTime dateTime

Specifies the current DateTime instance.

Returns
Type Description
System.String

Returns the value of the current DateTime instance as a 21-digit timestamp.

Remarks

Digit timestamps contain no separators between the timestamp parts. The number of digits expressing fractional seconds is 7.

| Improve this Doc View Source

ToTimestamp(DateTime)

Converts the value of the current DateTime instance to an equivalent timestamp string.

Declaration
public static string ToTimestamp(this DateTime dateTime)
Parameters
Type Name Description
System.DateTime dateTime

Specifies the current DateTime instance.

Returns
Type Description
System.String

Returns the value of the current DateTime instance as a timestamp string.

| Improve this Doc View Source

ToTimestamp(DateTime, Char)

Converts the value of the current DateTime instance to an equivalent timestamp string.

Declaration
public static string ToTimestamp(this DateTime dateTime, char dateTimeSeparator)
Parameters
Type Name Description
System.DateTime dateTime

Specifies the current DateTime instance.

System.Char dateTimeSeparator

Specifies a character that is used to separate the date and time part in the timestamp.

Returns
Type Description
System.String

Returns the value of the current DateTime instance as a timestamp string.

| Improve this Doc View Source

ToTimestamp(DateTime, Char, Boolean)

Converts the value of the current DateTime instance to an equivalent timestamp string.

Declaration
public static string ToTimestamp(this DateTime dateTime, char dateTimeSeparator, bool addFractionalSeconds)
Parameters
Type Name Description
System.DateTime dateTime

Specifies the current DateTime instance.

System.Char dateTimeSeparator

Specifies a character that is used to separate the date and time part in the timestamp.

System.Boolean addFractionalSeconds

If true, adds fractional seconds to the timestamp.

Returns
Type Description
System.String

Returns the value of the current DateTime instance as a timestamp string.

| Improve this Doc View Source

ToTimestamp(DateTime, Char, Boolean, Boolean)

Converts the value of the current DateTime instance to an equivalent timestamp string.

Declaration
public static string ToTimestamp(this DateTime dateTime, char dateTimeSeparator, bool addFractionalSeconds, bool addUtcOffset)
Parameters
Type Name Description
System.DateTime dateTime

Specifies the current DateTime instance.

System.Char dateTimeSeparator

Specifies a character that is used to separate the date and time part in the timestamp.

System.Boolean addFractionalSeconds

If true, adds fractional seconds to the timestamp.

System.Boolean addUtcOffset

If true, adds the offset to Coordinated Universal Time to the timestamp.

Returns
Type Description
System.String

Returns the value of the current DateTime instance as a timestamp string.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX