DateTimeMethods class | QSYS API Reference Guide

Estimated reading time: 33 minutes

Contains extension methods for handling Date/Time/Timestamp conversions.

Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll

Inheritance: Object

Methods

Signature Description
AddDuration(DateTime, Double, DurationCode) Adds a duration span to a date or a timestamp value.
AddDurationToTime(DateTime, Double, DurationCode) Adds a duration span to a time value.
GetFormatLength(DateTimeDataKind, DateTimeFormat, DateTimeSeparator) Returns the length of the string representation of a date/time/timestamp type.
MergeDate(DateTime, DateTime) Merges a date into the date part of a timestamp.
MergeTime(DateTime, DateTime) Merges a time into the time part of a timestamp.
MoveLeft(DateTime, DateTimeDataKind, DateTimeFormat, DateTimeSeparator, String) RPG’s MOVEL. Moves left a DateTime to string.
MoveLeft(DateTime, DateTimeDataKind, DateTimeFormat, Decimal, Int32, Int32) RPG’s MOVEL. Moves left a DateTime to decimal.
MoveLeft(DateTime, DateTimeDataKind, DateTimeFormat, Int16) RPG’s MOVEL. Moves left a datetime into a int2 (short).
MoveLeft(DateTime, DateTimeDataKind, DateTimeFormat, Int32) RPG’s MOVEL. Moves left a datetime into a int4 (int).
MoveLeft(DateTime, DateTimeDataKind, DateTimeFormat, Int64) RPG’s MOVEL. Moves left a datetime into a int8 (long).
MoveLeftToChar(DateTime, DateTimeDataKind, DateTimeFormat) RPG’s MOVEL. Moves left a date, time, timestamp in the given format to a char value.
MoveLeftWithPad(DateTime, DateTimeDataKind, DateTimeFormat, DateTimeSeparator, String) RPG’s MOVEL. Moves left a DateTime to string with pad.
MoveLeftWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Decimal, Int32, Int32) RPG’s MOVEL. Moves left a DateTime to decimal with pad.
MoveLeftWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int16) RPG’s MOVE. Moves right a datetime into a int2 (short) with pad.
MoveLeftWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int32) RPG’s MOVEL. Moves left a datetime into a int4 (int).
MoveLeftWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int64) RPG’s MOVEL. Moves left a datetime into a int8 (long).
MoveRight(DateTime, DateTimeDataKind, DateTimeFormat, DateTimeSeparator, String) RPG’s MOVE. Moves right a DateTime to string.
MoveRight(DateTime, DateTimeDataKind, DateTimeFormat, Decimal, Int32, Int32) RPG’s MOVE. Moves right s DateTime to decimal.
MoveRight(DateTime, DateTimeDataKind, DateTimeFormat, Int16) RPG’s MOVE. Moves right a datetime into a int2 (short).
MoveRight(DateTime, DateTimeDataKind, DateTimeFormat, Int32) RPG’s MOVE. Moves right a datetime into a int4 (int).
MoveRight(DateTime, DateTimeDataKind, DateTimeFormat, Int64) RPG’s MOVE. Moves right a datetime into a int8 (long).
MoveRightToChar(DateTime, DateTimeDataKind, DateTimeFormat) RPG’s MOVE. Moves right a date, time, timestamp in the given format to a char value.
MoveRightWithPad(DateTime, DateTimeDataKind, DateTimeFormat, DateTimeSeparator, String) RPG’s MOVE. Moves right a DateTime to string with pad.
MoveRightWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Decimal, Int32, Int32) RPG’s MOVE. Moves right a DateTime to decimal with pad.
MoveRightWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int16) RPG’s MOVE. Moves right a datetime into a int2 (short) with pad.
MoveRightWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int32) RPG’s MOVE. Moves right a datetime into a int4 (int) with pad.
MoveRightWithPad(DateTime, DateTimeDataKind, DateTimeFormat, Int64) RPG’s MOVE. Moves right a datetime into a int8 (long) with pad.
NormalizeYear(DateTime) Turns a 4 digit year into a 2 digit year between 1940 and 2039
SubtractDuration(DateTime, Double, DurationCode) Subtracts a duration span from a date or a timestamp value.
SubtractDurationFromTime(DateTime, Double, DurationCode) Subtracts a duration span from a time value.
TimestampToDate(DateTime) Returns the Date portion of a timestamp.
TimestampToTime(DateTime) Returns the hours, minutes, and seconds of a timestamp.
TimestampToUSATime(DateTime) Returns the hours and minutes of a timestamp.
ToFixedDecimal(DateTime, DateTimeDataKind, DateTimeFormat, Int32, Int32) Converts a dateTime type, converts it to a decimal.
ToFixedDecimal(DateTime, DateTimeDataKind, DateTimeFormat) Converts a dateTime type to decimal.
ToInt16(DateTime, DateTimeDataKind, DateTimeFormat, Boolean) Converts a dateTime type to int 16.
ToInt32(DateTime, DateTimeDataKind, DateTimeFormat, Boolean) Converts a dateTime type to int 32.
ToInt64(DateTime, DateTimeDataKind, DateTimeFormat, Boolean) Converts a dateTime type to int 64.
ToString(DateTime, DateTimeDataKind, DateTimeFormat, DateTimeSeparator) Converts a DateTime with the specified Kind and Format to a string using the specified separator.

DateTime AddDuration(DateTime dateTime, double duration, DurationCode durationCode)

Adds a duration span to a date or a timestamp value.

DateTime AddDuration(DateTime dateTime, double duration, DurationCode durationCode)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
Double duration A double value representing duration.
DurationCode durationCode Code determining what duration represents.

Returns

Type Description
DateTime The resulting Date or Timestamp value after adding to it the given duration.

DateTime AddDurationToTime(DateTime dateTime, double duration, DurationCode durationCode)

Adds a duration span to a time value.

DateTime AddDurationToTime(DateTime dateTime, double duration, DurationCode durationCode)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value specifying a time value.
Double duration A double value representing duration.
DurationCode durationCode Code determining what duration represents.

Returns

Type Description
DateTime The resulting Time value after adding to it the given duration.

int GetFormatLength(DateTimeDataKind kind, DateTimeFormat format, DateTimeSeparator separator)

Returns the length of the string representation of a date/time/timestamp type.

int GetFormatLength(DateTimeDataKind kind, DateTimeFormat format, DateTimeSeparator separator)

Parameters

Type Parameter name Description
DateTimeDataKind kind The kind of datetime type.
DateTimeFormat format The format of the type.
DateTimeSeparator separator The datetime separator.

Returns

Type Description
Int32 The computed length.

DateTime MergeDate(DateTime timestamp, DateTime date)

Merges a date into the date part of a timestamp.

DateTime MergeDate(DateTime timestamp, DateTime date)

Parameters

Type Parameter name Description
DateTime timestamp timestamp to be merged.
DateTime date date to merge.

Returns

Type Description
DateTime .NET DateTime value.

DateTime MergeTime(DateTime timestamp, DateTime time)

Merges a time into the time part of a timestamp.

DateTime MergeTime(DateTime timestamp, DateTime time)

Parameters

Type Parameter name Description
DateTime timestamp timestamp to be merged.
DateTime time time to merge.

Returns

Type Description
DateTime .NET DateTime value.

string MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

RPG’s MOVEL. Moves left a DateTime to string.

string MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
DateTimeSeparator dateTimeSeparator The DateTimeSeparator of the value.
String targetOperand The string value that is the target of the MOVEL.

Returns

Type Description
String The string resulting from the MOVEL operation of the dateTime with the given format and separator into the targetOperand string.

decimal MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

RPG’s MOVEL. Moves left a DateTime to decimal.

decimal MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Decimal targetOperand The targetOperand decimal.
Int32 digits The number of digits in the targetOperand.
Int32 decimals The number of decimal places in the targetOperand.

Returns

Type Description
Decimal The resulting decimal value of the operation.

short MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

RPG’s MOVEL. Moves left a datetime into a int2 (short).

short MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int16 targetOperand The short value target of the operation.

Returns

Type Description
Int16 The resulting short value of the operation.

int MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

RPG’s MOVEL. Moves left a datetime into a int4 (int).

int MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int32 targetOperand The int value target of the operation.

Returns

Type Description
Int32 The resulting int value of the operation.

long MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

RPG’s MOVEL. Moves left a datetime into a int8 (long).

long MoveLeft(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int64 targetOperand The long value target of the operation.

Returns

Type Description
Int64 The resulting long value of the operation.

char MoveLeftToChar(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

RPG’s MOVEL. Moves left a date, time, timestamp in the given format to a char value.

char MoveLeftToChar(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.

Returns

Type Description
Char The first character in the string representation of the DateTime value.

string MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

RPG’s MOVEL. Moves left a DateTime to string with pad.

string MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
DateTimeSeparator dateTimeSeparator The DateTimeSeparator of the value.
String targetOperand The string value that is the target of the MOVEL.

Returns

Type Description
String The string resulting from the MOVEL operation of the dateTime with the given format and separator into the targetOperand string.

decimal MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

RPG’s MOVEL. Moves left a DateTime to decimal with pad.

decimal MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Decimal targetOperand The targetOperand decimal.
Int32 digits The number of digits in the targetOperand.
Int32 decimals The number of decimal places in the targetOperand.

Returns

Type Description
Decimal The resulting decimal value of the operation.

short MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

RPG’s MOVE. Moves right a datetime into a int2 (short) with pad.

short MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int16 targetOperand The short value target of the operation.

Returns

Type Description
Int16 The resulting short value of the operation.

int MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

RPG’s MOVEL. Moves left a datetime into a int4 (int).

int MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int32 targetOperand The int value target of the operation.

Returns

Type Description
Int32 The resulting int value of the operation.

long MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

RPG’s MOVEL. Moves left a datetime into a int8 (long).

long MoveLeftWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int64 targetOperand The long value target of the operation.

Returns

Type Description
Int64 The resulting long value of the operation.

string MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

RPG’s MOVE. Moves right a DateTime to string.

string MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
DateTimeSeparator dateTimeSeparator The DateTimeSeparator of the value.
String targetOperand The string value that is the target of the MOVE.

Returns

Type Description
String The string resulting from the MOVE operation of the dateTime with the given format and separator into the targetOperand string.

decimal MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

RPG’s MOVE. Moves right s DateTime to decimal.

decimal MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
Decimal targetOperand The decimal value that is the target of the MOVE.
Int32 digits The total number of digits in the decimal number.
Int32 decimals The number of decimal positions in the decimal number.

Returns

Type Description
Decimal The decimal number resulting from the MOVE operation of the dateTime with the given format and separator into the targetOperand number.

short MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

RPG’s MOVE. Moves right a datetime into a int2 (short).

short MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int16 targetOperand The short value target of the operation.

Returns

Type Description
Int16 The resulting short value of the operation.

int MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

RPG’s MOVE. Moves right a datetime into a int4 (int).

int MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int32 targetOperand The int value target of the operation.

Returns

Type Description
Int32 The resulting int value of the operation.

long MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

RPG’s MOVE. Moves right a datetime into a int8 (long).

long MoveRight(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int64 targetOperand The long value target of the operation.

Returns

Type Description
Int64 The resulting long value of the operation.

char MoveRightToChar(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

RPG’s MOVE. Moves right a date, time, timestamp in the given format to a char value.

char MoveRightToChar(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.

Returns

Type Description
Char The last character in the string representation of the DateTime value.

string MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

RPG’s MOVE. Moves right a DateTime to string with pad.

string MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator, string targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
DateTimeSeparator dateTimeSeparator The DateTimeSeparator of the value.
String targetOperand The string value that is the target of the MOVE.

Returns

Type Description
String The string resulting from the MOVE operation of the dateTime with the given format and separator into the targetOperand string.

decimal MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

RPG’s MOVE. Moves right a DateTime to decimal with pad.

decimal MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, decimal targetOperand, int digits, int decimals)

Parameters

Type Parameter name Description
DateTime dateTime The date/time/timestamp value to move.
DateTimeDataKind dateTimeKind The DateTimeDataKind value that specifies whether it is a date, time, or timestamp.
DateTimeFormat dateTimeFormat The DateTimeFormat of the value.
Decimal targetOperand The decimal value that is the target of the MOVE.
Int32 digits The total number of digits in the decimal number.
Int32 decimals The number of decimal positions in the decimal number.

Returns

Type Description
Decimal The decimal number resulting from the MOVE operation of the dateTime with the given format and separator into the targetOperand number.

short MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

RPG’s MOVE. Moves right a datetime into a int2 (short) with pad.

short MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, short targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int16 targetOperand The short value target of the operation.

Returns

Type Description
Int16 The resulting short value of the operation.

int MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

RPG’s MOVE. Moves right a datetime into a int4 (int) with pad.

int MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int32 targetOperand The int value target of the operation.

Returns

Type Description
Int32 The resulting int value of the operation.

long MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

RPG’s MOVE. Moves right a datetime into a int8 (long) with pad.

long MoveRightWithPad(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, long targetOperand)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The kind that the dateTime should be interpreted as.
DateTimeFormat dateTimeFormat The format of the dateTime.
Int64 targetOperand The long value target of the operation.

Returns

Type Description
Int64 The resulting long value of the operation.

DateTime NormalizeYear(DateTime dateTime)

Turns a 4 digit year into a 2 digit year between 1940 and 2039

DateTime NormalizeYear(DateTime dateTime)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.

Returns

Type Description
DateTime .NET DateTime value.

DateTime SubtractDuration(DateTime dateTime, double duration, DurationCode durationCode)

Subtracts a duration span from a date or a timestamp value.

DateTime SubtractDuration(DateTime dateTime, double duration, DurationCode durationCode)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
Double duration A double value representing duration.
DurationCode durationCode Code determining what duration represents.

Returns

Type Description
DateTime The resulting Date or Timestamp value after subracting from it the given duration.

DateTime SubtractDurationFromTime(DateTime dateTime, double duration, DurationCode durationCode)

Subtracts a duration span from a time value.

DateTime SubtractDurationFromTime(DateTime dateTime, double duration, DurationCode durationCode)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value specifying a time value.
Double duration A double value representing duration.
DurationCode durationCode Code determining what duration represents.

Returns

Type Description
DateTime The resulting Time value after subtracting from it the given duration.

DateTime TimestampToDate(DateTime timestamp)

Returns the Date portion of a timestamp.

DateTime TimestampToDate(DateTime timestamp)

Parameters

Type Parameter name Description
DateTime timestamp The timestamp as a DateTime value.

Returns

Type Description
DateTime The Date portion as a DateTime value.

DateTime TimestampToTime(DateTime timestamp)

Returns the hours, minutes, and seconds of a timestamp.

DateTime TimestampToTime(DateTime timestamp)

Parameters

Type Parameter name Description
DateTime timestamp The timestamp as a DateTime value.

Returns

Type Description
DateTime The Time portion in hours, minutes, and seconds as a DateTime value.

DateTime TimestampToUSATime(DateTime timestamp)

Returns the hours and minutes of a timestamp.

DateTime TimestampToUSATime(DateTime timestamp)

Parameters

Type Parameter name Description
DateTime timestamp The timestamp as a DateTime value.

Returns

Type Description
DateTime The Time portion in hours and minutes only as a DateTime value.

decimal ToFixedDecimal(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int digits, int decimals)

Converts a dateTime type, converts it to a decimal.

decimal ToFixedDecimal(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, int digits, int decimals)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.
Int32 digits Number of digits in the targetOperand.
Int32 decimals Number of decimal places in the targetOperand.

Returns

Type Description
Decimal The decimal number that results from the conversion.

decimal ToFixedDecimal(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

Converts a dateTime type to decimal.

decimal ToFixedDecimal(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.

Returns

Type Description
Decimal The decimal number that results from the conversion.

short ToInt16(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Converts a dateTime type to int 16.

short ToInt16(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.
Boolean throwOnOverflow Default is false. Pass true if a runtime exception is desired when the conversion doesn’t fit.

Returns

Type Description
Int16 The Int16 number that results from the conversion.

int ToInt32(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Converts a dateTime type to int 32.

int ToInt32(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.
Boolean throwOnOverflow Default is false. Pass true if a runtime exception is desired when the conversion doesn’t fit.

Returns

Type Description
Int32 The Int32 number that results from the conversion.

long ToInt64(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Converts a dateTime type to int 64.

long ToInt64(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, bool throwOnOverflow)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.
Boolean throwOnOverflow Default is false. Pass true if a runtime exception is desired when the conversion doesn’t fit.

Returns

Type Description
Int64 The Int64 number that results from the conversion.

string ToString(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator)

Converts a DateTime with the specified Kind and Format to a string using the specified separator.

string ToString(DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat, DateTimeSeparator dateTimeSeparator)

Parameters

Type Parameter name Description
DateTime dateTime .NET DateTime value.
DateTimeDataKind dateTimeKind The Kind of the DateTime being converted.
DateTimeFormat dateTimeFormat The Format of the DateTime being converted.
DateTimeSeparator dateTimeSeparator The separator to use in the returned string.

Returns

Type Description
String A string representation of a DateTime in the given format using the specified separator.