FSharpAux


DateTime

Namespace: FSharpAux

Functions and values

Function or valueDescription
compare timeA toTimeB
Signature: timeA:DateTime -> toTimeB:DateTime -> int

Compares two instances of DateTime and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance. Before comparing DateTime objects, ensure that the objects represent times in the same time zone.

compareWithConversion(...)
Signature: commonFormat:DateTimeKind -> timeA:DateTime -> toTimeB:DateTime -> int

Compares two instances of DateTime and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance. Performs a conversion of the two input times to the specified DateTimeKind before comparing

isEarlier timeA toTimeB
Signature: timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is earlier than the second instance, and false otherwise.

isEarlierWithConversion(...)
Signature: commonFormat:DateTimeKind -> timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is earlier than the second instance, and false otherwise. Performs a conversion of the two input times to the specified DateTimeKind before comparing

isLater timeA toTimeB
Signature: timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is later than the second instance, and false otherwise.

isLaterWithConversion(...)
Signature: commonFormat:DateTimeKind -> timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is later than the second instance, and false otherwise. Performs a conversion of the two input times to the specified DateTimeKind before comparing

isLocal(d)
Signature: d:DateTime -> bool

Returns true when the time represented by the input is based on local time, otherwise false.

isSame timeA toTimeB
Signature: timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is the same as the second instance, and false otherwise.

isSameWithConversion(...)
Signature: commonFormat:DateTimeKind -> timeA:DateTime -> toTimeB:DateTime -> bool

Compares two instances of DateTime and returns true if the first instance is is the same as the second instance, and false otherwise. Performs a conversion of the two input times to the specified DateTimeKind before comparing

isUnspecified(d)
Signature: d:DateTime -> bool

Returns true when the time represented by the input is based on neither local time or Coordinated Universal Time (UTC), otherwise false.

isUtc(d)
Signature: d:DateTime -> bool

Returns true when the time represented by the input is based on Coordinated Universal Time (UTC), otherwise false.

parse(s)
Signature: s:string -> DateTime

Converts the string representation of a date and time to its DateTime equivalent. Throws an exception if the string is not in correct format.

toLocal(d)
Signature: d:DateTime -> DateTime

Converts the value of the current DateTime object to local time.

toUtc(d)
Signature: d:DateTime -> DateTime

Converts the value of the current DateTime object to Coordinated Universal Time (UTC).

tryParse(s)
Signature: s:string -> DateTime option

Converts the specified string representation of a date and time to its DateTime equivalent. Returns Some value if the conversion succeeded, and otherwise None.

Fork me on GitHub