Date - (Built-in Functions)
Date
The returned value can be compared with values read from database columns with type SQL_DATE, SQL_TIME or SQL_TIMESTAMP or can be formatted as a string using FormatDate.
Expression Syntax: CvDate(year, month, day, hour, minutes, seconds)
year: The year in the range 100 to 9999.
month: The month, in the range 0 to 12.
day: The day, in the range 0 to 31.
hour: The hour, in the range 0 to 23 (optional).
minutes: The minute, in the range 0 to 59 (optional).
seconds: The second, in the range 0 to 59 (optional).
Example:
CvDate(2001, 6, 29, 11, 27, 0)
returns 29/06/2001 11:27:00
Expression Syntax: Date(date)
date: A property or a literal string representing a date.
Example:
Date()
returns the current date and time.
Date(someDateAndTime@)
returns a date time value for a date property.
Date("2001-06-29T11:27:00")
returns 29/06/2001 11:27:00.
Expression Syntax: Day(date)
date
A date time value of the calendar month required.
Example:
Day(Date())
returns the current day of the month.
Day(someDateAndTime@)
returns the Month day of the date.
Day(Date("2001-06-29T11:27:00"))
returns 29.
Expression Syntax: DayOfWeek(date)
date
A date time value of the week day required
Example:
DayOfWeek(Date())
returns the current day of the week.
DayOfWeek(someDateAndTime@)
returns the week day of the date.
DayOfWeek(Date("2001-06-29T11:27:00"))
returns 6.
Expression Syntax: DayOfYear(date)
date
A date time value of the annual day required
Example:
DayOfYear(Date())
returns the current day of the year.
DayOfYear(someDateAndTime@)
returns the annual day of the date.
DayOfYear(Date("2001-06-29T11:27:00"))
returns 180.
Expression Syntax: Hour(property)
property
The name of the date/time property.
Example:
Hour(startdate@)
returns the hour in the date/time property entered in the property field, in this example startdate@.
Expression Syntax: Minute(property)
property
The name of the date/time property.
Example:
Minute(startdate@)
returns the minute in the date/time property entered in the property field, in this example startdate@.
Expression Syntax: Month(property)
property
The name of the date/time property.
Example:
Month(startdate@)
returns the month in the date/time property entered in the property field, in this example startdate@.
Expression Syntax: Now()
Example:
Now()
Returns today's date and time in the format day/month/year hour/minute/seconds
Expression Syntax: ParseDate(str$)
Example:
ParseDate(startdate$)
returns the month in the date/time property entered in the property field, in this example startdate$.
Expression Syntax: Second(property)
property
The name of the date/time property.
Example:
Second(startdate@)
returns the second in the date/time property entered in the property field, in this example startdate@.
Timespan returns a decimal value of days from a given number of days, hours, minutes and seconds.
Expression Syntax: Timespan(days, hours, minutes, seconds)
days: The number of days.
hours: The number of hours.
minutes: The number of minutes.
seconds: The number of seconds.
Note: If days, hours, minutes or seconds values are not required enter 0 in the appropriate position in the parameter line.
Examples:
Timespan(13, 19, 30, 0)
will return 13.8125
Timespan(0, 18, 0, 0)
will return 0.75
Expression Syntax: Year(property)
Example:
Year(startdate@)
returns the year in the date/time property entered in the property field, in this example startdate@.