Date and Time Functions
Alpha Five provides the following Date and Time functions.
C = character
D = Date value (Date variable)
CD = Formatted date (Character variable)
CT = Formatted date time (Character variable)
CY = Formatted time (Character variable)
L = Logical value (Logical variable)
N = Numeric value (Numeric variable)
P = Pointer with dot variables
T = Date time value (Time variable)
Y = Time value (Short time variable)
|
Group |
|
Output |
Function |
Description |
|
Arithmetic |
V5 |
D |
Add or subtract a number of days to or from a date to produce a date. | |
|
V5 |
T |
Add or subtract a number of seconds to or from a date time to produce a date time. | ||
|
V6 |
Y |
Add or subtract a number of seconds to or from a short time to produce a short time. | ||
|
V5 |
N |
Subtract one date from another to produce the interval in days. | ||
|
V5 |
N |
Subtract one date time from another to produce the interval in seconds. | ||
|
V6 |
N |
Subtract one short time from another to produce the interval in seconds. | ||
|
Calendars |
V5 |
C |
Displays a calendar and returns a formatted date string. | |
|
V5 |
C |
Displays a Windows style dialog and returns formatted date string. | ||
|
V5 |
C |
Displays an HTML formatted dialog and returns a formatted date string. | ||
|
General |
V5 |
D |
Returns today's Date. | |
|
V8 |
D |
Returns the first date of a month relative to a specified date (default value is today). | ||
|
V8 |
D |
Returns the first date of the previous month relative to a specified date (default value is today). | ||
|
V8 |
D |
Returns the last date of a month relative to a specified date (default value is today). | ||
|
V8 |
D |
Returns the last date of a previous month relative to a specified date (default value is today). | ||
|
V6 |
N |
Returns the difference between the computer's time zone and Greenwich Mean Time. | ||
|
V5 |
L |
Returns .T. if the character string is a valid representation of a Date value. | ||
|
V6 |
L |
Returns .T. if the character string is a valid representation of a Short Time value. | ||
|
V6 |
L |
Returns .T. if the character string is a valid representation of a Time value. | ||
|
V5 |
T |
Returns the current date/time, correct to the millisecond, in the Time data type. | ||
|
V5 |
D |
Assigns a NULL value to a date. | ||
|
V6 |
D |
Displays a HTML calendar and returns a date. | ||
|
V6 |
C |
Calls the GetTimeZoneOffset() function and formats the result as a character string. | ||
|
V7 |
P |
Returns information about the time settings of a computer. | ||
|
Calculation Functions |
V5 |
D |
Adds a specified number of business days ( Add_Days ) to a Starting_Date and returns an Ending_Date. | |
|
V5 |
D |
Returns an Ending_Date equal to the specified Starting_Date plus the specified Number_Of_Months. | ||
|
V5 |
D |
Returns an Ending_Date equal to the specified Date plus the specified Number_Of_Year s. | ||
|
V5 |
N |
Computes the number of years since a Starting_Date and returns an integer. | ||
|
V5 |
N |
Computes the number of business days between two dates. | ||
|
V8 |
N |
Given a date, returns the first day of its month. | ||
|
V8 |
N |
Given a date, returns the first day of its previous month. | ||
|
V5 |
L |
Determines if a Date value is in a specified Month. | ||
|
V8 |
N |
Given a date, returns the last day of its month. | ||
|
V8 |
N |
Given a date, returns the last day of its previous month. | ||
|
V5 |
D |
Increments the date by one. | ||
|
V5 |
D |
Returns the date of the last day of the month in which date occurs. | ||
|
V5 |
D |
Returns the date of the first day of the month in which date occurs. | ||
|
V5 |
CD |
Returns the date for the Nth occurrence of the specified day of the week starting in the specified month and year. | ||
|
Conversion Functions |
V6 |
T |
Converts a date string formatted by A5_ANSIDATE(), A5_RFC1123DATE(), A5_RFC822DATE(), or A5_RFC850DATE() into a time-date value. | |
|
V5 |
D |
Converts a Date to a Formatted_Date character string in the form "YYYYMMDD". | ||
|
V5 |
C |
Returns a character string containing the name of the day of the week for the specified Date. | ||
|
V5 |
C |
Returns the Month_Name in the specified Date. | ||
|
V6 |
T |
Converts variables from one type to another, preserving the data if possible. | ||
|
V7 |
C |
Converts a short time value to a sortable character equivalent. | ||
|
V7 |
C |
Converts a time value to a sortable character equivalent. | ||
|
V5 |
D |
Converts a character string containing date information to a Date value. | ||
|
V6 |
T |
Converts a date and time string to a date time value. | ||
|
V6 |
Y |
Converts a time string to a short time value. | ||
|
V5 |
C |
Returns a character string containing the year in the form "YYYY" based on the specified Date_Value. | ||
|
V5 |
CT |
Returns any portion of a Date_Time as a formatted string. | ||
|
V5 |
D |
Returns Date_Value for the specified year, month and day. | ||
|
V5 |
N |
Returns an integer corresponding to the day of the month for a given Date or Date_Time. | ||
|
V5 |
N |
Returns the number of a given day name. | ||
|
V5 |
N |
Returns an integer indicating the day of the week for the Date_Value. | ||
|
V7 |
N |
Returns the ISO day of the week. | ||
|
V5 |
N |
Converts Date_Value to a Julian date, which is an integer value measured in days from a special starting date. | ||
|
V5 |
D |
Converts a Julian date (which is an integer value measured in days) to an Alpha Five Date value. | ||
|
V5 |
N |
Returns an integer equal to the month number (1-12) of the specified Date or Date_Time. | ||
|
V5 |
N |
Returns the month number (1 to 12) for a given month name. | ||
|
V5 |
D |
Converts a character Date_Time_String of format "YYYY-MM-DD HH:MM:SS.SSS" to a date value. | ||
|
V5 |
T |
Returns a Date_Time_Value in a Time variable by parsing the character date time value specified by Formatted_Date_Time according to the format specified by Format_String. | ||
|
V8 |
Y |
Extracts the hours, minutes, or seconds value from a Short_Time. | ||
|
V7 |
D |
Converts a date string in the format YYYYMMDD into a date. | ||
|
V6 |
T |
Creates a "time" variable from year, month, day, hour, minute, and second values. | ||
|
V5 |
N |
Converts a Formatted_Time_String containing a time value to an integer Count equal to the number of seconds past midnight. | ||
|
V6 |
N |
Returns the number of the week in the year for a date value. | ||
|
V7 |
N |
Returns the ISO week number. | ||
|
V7 |
C |
Returns the fully qualified ISO week number. | ||
|
V6 |
T |
Converts a CIM date time string as used by WMI to an Alpha Five Date Time value in the local time zone. | ||
|
V5 |
N |
Returns a four digit integer equal to the year portion of the specified Date or Date_Time. | ||
|
V7 |
D |
Returns the first day of the ISO year for a given year. | ||
|
Formatting Functions |
V5 |
|
Predefined date formats for use with functions such as DTOC(). | |
|
V5 |
|
Rules for coding date and time formats. | ||
|
V6 |
CD |
Reformats a date string. | ||
|
V7 |
CT |
Reformats a date time string. | ||
|
V5 |
CT |
Takes a date, either as a time or character, and converts it to a string, following the RFC 1123 format. | ||
|
V6 |
CT |
Takes a date, either as a time or character, and converts it to a string, following the RFC 1123 format. | ||
|
V6 |
CT |
Takes a date, either as a time or character, and converts it to a string, following the RFC 822 format. | ||
|
V6 |
CT |
Takes a date, either as a time or character, and converts it to a string, following the RFC 850 format. | ||
|
V5 |
CY |
Returns Formatted_Short_Time containing the system time | ||
|
V5 |
CD |
Creates a formatted character string representation of the Date_Value. | ||
|
V5 |
- |
Displays the Data Format dialog box and returns the number of the selected format. | ||
|
V5 |
CD |
Returns a formatted character string in the DD Month YYYY format for the specified Date_Value. | ||
|
V5 |
CD |
DTOC()returns a formatted character string for the specified Date or Date_Time value. | ||
|
V5 |
CD |
Converts a Date_Value to a Formatted_Date character string in the form "YYYYMMDD." | ||
|
V5 |
CD |
Converts a Date_Value to a Formatted_Date character string. Refer to Display Formats. | ||
|
V7 |
CD |
Reformats a Formatted_Date character string for web applications. | ||
|
V5 |
CY |
Returns Greenwich Mean Time as a Formatted_Short_Time. | ||
|
V5 |
CD |
Returns a Formatted_Date in the Month DD, YYYY format for the specified Date_Value. | ||
|
V8 |
CY |
Formats a date value to "{YYYY-MM-DD}". | ||
|
V5 |
CT |
Returns a character string with a formatted Date_Time_Value containing the system time. | ||
|
V5 |
CY |
Returns a Formatted_Short_Time based on the specified Number_Of_Seconds past midnight. |
See Also
Predefined Date Formats, Date and Time Format Codes, Date and Time Conversion Matrix