DateTime
DateTime functions are used for parsing and manipulating the platform's date/time timestamps. Due to various technical reasons the platform represents timestamps using the long data type instead of the native .NET DateTime and Python DateTime structure (see the DateTimeConvert function).
Sections
Name |
Description |
Adds/subtract a specified number of days to a specified date/time. |
|
Adds/subtract a specified number of hours to a specified date/time. |
|
Adds/subtract a specified number of minutes to a specified date/time. |
|
Adds/subtract a specified number of months to a specified date/time. |
|
Adds/subtract a specified number of seconds to a specified date/time. |
|
Adds/subtract a specified number of years to a specified date/time. |
|
Converts a specified date/time to a native .NET date/time structure. |
|
Creates a new date/time from specified date/time fragments. The new date/time will be specified in the selected time zone, which is UTC by default. (See DateTimeSetUTCZone and DateTimeSetLocalZone) |
|
Gets the Desktop's current date/time. |
|
Gets the day of month at a specified date/time (1 to 31) |
|
Gets the distance in days between two specified date/times. |
|
Gets the day of week at a specified date/time. |
|
Gets the day of year at a specified date/time. (0 to 364) |
|
Gets the Desktop's end date/time. |
|
Gets the hour at a specified date/time. (0 to 23) |
|
Gets the distance in hours between two specified date/times. |
|
Checks whether a specified date/time is a leap year. |
|
Gets the maximum possible date/time. |
|
Gets the microseconds at a specified date/time. |
|
Gets the milliseconds at a specified date/time. |
|
Gets the minimum possible date/time. |
|
Gets the minutes at a specified date/time. (0 to 59) |
|
Gets the distance in minutes between two specified date/times. |
|
Gets the month at a specified date/time. (1 to 12) |
|
Gets the seconds at a specified date/time. (0 to 59) |
|
Gets the distance in seconds between two specified date/times. |
|
Sets the time zone of all the date/time functions to the system's local zone. Call this function once prior to calling other DateTime functions in order for them to be in the local zone. |
|
Sets the time zone of all the date/time functions to a specified time zone. Call this function once prior to calling other DateTime functions in order for them to be in the specified time zone. |
|
Resets the time zone of all the date/time functions to UTC. Call this function once prior to calling other DateTime functions in order for them to be in UTC. Note that UTC is the default time zone. |
|
Gets the Desktop's first start date/time since the last reset. |
|
Gets the string representation of a date/time. (yyyy-MM-dd HH:mm:ss) |
|
Gets the year at a specified date/time. |
long DateTimeAddDays(long dateTime, int days) |
|||||||||
Adds/subtract a specified number of days to a specified date/time. Returns The specified date/time after adding/subtracting the specified days. Parameters
Scripts All |
long DateTimeAddHours(long dateTime, int hours) |
|||||||||
Adds/subtract a specified number of hours to a specified date/time. Returns The specified date/time after adding/subtracting the specified hours. Parameters
Scripts All |
long DateTimeAddMinutes(long dateTime, int minutes) |
|||||||||
Adds/subtract a specified number of minutes to a specified date/time. Returns The specified date/time after adding/subtracting the specified minutes. Parameters
Scripts All |
long DateTimeAddMonths(long dateTime, int months) |
|||||||||
Adds/subtract a specified number of months to a specified date/time. Returns The specified date/time after adding/subtracting the specified months. Parameters
Scripts All |
long DateTimeAddSeconds(long dateTime, int seconds) |
|||||||||
Adds/subtract a specified number of seconds to a specified date/time. Returns The specified date/time after adding/subtracting the specified seconds. Parameters
Scripts All |
long DateTimeAddYears(long dateTime, int years) |
|||||||||
Adds/subtract a specified number of years to a specified date/time. Returns The specified date/time after adding/subtracting the specified years. Parameters
Scripts All |
DateTime DateTimeConvert(long dateTime) |
||||||
Converts a specified date/time to a native .NET date/time structure. Returns The specified date/time in the native .NET date/time structure. Parameters
Scripts All |
long DateTimeCreate(int year, int month, int day, int hour, int minute, int second) |
|||||||||||||||||||||
Creates a new date/time from specified date/time fragments. The new date/time will be specified in the selected time zone, which is UTC by default. (See DateTimeSetUTCZone and DateTimeSetLocalZone) Returns The date/time created in the set time zone from the specified date/time fragments. Parameters
Scripts All |
long DateTimeCurrent() |
Gets the Desktop's current date/time. Returns The Desktop's current date/time. Scripts All |
int DateTimeDay(long dateTime) |
||||||
Gets the day of month at a specified date/time (1 to 31) Returns The day of month at the specified date/time. (1 to 31) Parameters
Scripts All |
double DateTimeDayDistance(long earlyDateTime, long lateDateTime) |
|||||||||
Gets the distance in days between two specified date/times. Returns The distance in days between the two specified date/times. Parameters
Scripts All |
C_Weekday DateTimeDayOfWeek(long dateTime) |
||||||
Gets the day of week at a specified date/time. Returns The day of week at the specified date/time. (View Options) Parameters
Scripts All |
int DateTimeDayOfYear(long dateTime) |
||||||
Gets the day of year at a specified date/time. (0 to 364) Returns The day of year at the specified date/time. (0 to 364) Parameters
Scripts All |
long DateTimeEnd() |
Gets the Desktop's end date/time. Returns The Desktop's end date/time. Scripts All |
int DateTimeHour(long dateTime) |
||||||
Gets the hour at a specified date/time. (0 to 23) Returns The hour at the specified date/time. (0 to 23) Parameters
Scripts All |
double DateTimeHourDistance(long earlyDateTime, long lateDateTime) |
|||||||||
Gets the distance in hours between two specified date/times. Returns The distance in hours between the two specified date/times. Parameters
Scripts All |
bool DateTimeIsLeapYear(long dateTime) |
||||||
Checks whether a specified date/time is a leap year. Returns True if the date/time is a leap year, false otherwise. Parameters
Scripts All |
long DateTimeMax() |
Gets the maximum possible date/time. Returns The maximum possible date/time, i.e. the last second of the year 9999. Scripts All |
int DateTimeMicrosecond(long dateTime) |
||||||
Gets the microseconds at a specified date/time. Returns The microseconds at the specified date/time. Parameters
Scripts All |
int DateTimeMillisecond(long dateTime) |
||||||
Gets the milliseconds at a specified date/time. Returns The milliseconds at the specified date/time. Parameters
Scripts All |
long DateTimeMin() |
Gets the minimum possible date/time. Returns The minimum possible date/time, i.e. the first second of the year 0001. Scripts All |
int DateTimeMinute(long dateTime) |
||||||
Gets the minutes at a specified date/time. (0 to 59) Returns The minutes at the specified date/time. (0 to 59) Parameters
Scripts All |
double DateTimeMinuteDistance(long earlyDateTime, long lateDateTime) |
|||||||||
Gets the distance in minutes between two specified date/times. Returns The distance in minutes between the two specified date/times. Parameters
Scripts All |
int DateTimeMonth(long dateTime) |
||||||
Gets the month at a specified date/time. (1 to 12) Returns The month at the specified date/time. (1 to 12) Parameters
Scripts All |
double DateTimeSecondDistance(long earlyDateTime, long lateDateTime) |
|||||||||
Gets the distance in seconds between two specified date/times. Returns The distance in seconds between the two specified date/times. Parameters
Scripts All |
int DateTimeSecond(long dateTime) |
||||||
Gets the seconds at a specified date/time. (0 to 59) Returns The seconds at the specified date/time. (0 to 59) Parameters
Scripts All |
DateTimeSetLocalZone() |
Sets the time zone of all the date/time functions to the system's local zone. Call this function once prior to calling other DateTime functions in order for them to be in the local zone. Scripts All |
DateTimeSetTimeZone(C_TimeZone timeZone) |
||||||
Sets the time zone of all the date/time functions to a specified time zone. Call this function once prior to calling other DateTime functions in order for them to be in the specified time zone. Parameters
Scripts All |
DateTimeSetUTCZone() |
Resets the time zone of all the date/time functions to UTC. Call this function once prior to calling other DateTime functions in order for them to be in UTC. Note that UTC is the default time zone. Scripts All |
long DateTimeStart() |
Gets the Desktop's first start date/time since the last reset. Returns The Desktop's start date/time. Scripts All |
string DateTimeString(long dateTime, bool onlyDate) |
|||||||||
Gets the string representation of a date/time. (yyyy-MM-dd HH:mm:ss) Returns The string representation of the date/time. (yyyy-MM-dd HH:mm:ss) Parameters
Scripts All |
int DateTimeYear(long dateTime) |
||||||
Gets the year at a specified date/time. Returns The year at the specified date/time. Parameters
Scripts All |