ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Note: These functions are also available in prefix syntax (Functions for managing Dates and Times (prefix syntax)).
The following functions are used to manage dates and times:
AgeReturns the age according to the date of birth.
BankHolidayIndicates whether a day is a public holiday or not.
BankHolidayAddIndicates that a day (or a list of days) is a public holiday.
BankHolidayDeleteAllClears the list of all public holidays.
BankHolidayListReturns the list of the public holidays defined by BankHolidayAdd.
ChronoEndStops a stopwatch and returns the time elapsed (in milliseconds) since the start of timing (call to ChronoStart).
ChronoPausePauses a stopwatch in order to measure the time spent on a process.
ChronoResetStops and resets a running stopwatch.
ChronoResumeRestarts a stopwatch that was stopped by ChronoEnd or ChronoPause.
ChronoStartStarts a stopwatch to measure the duration of a process (in milliseconds) and resets a running stopwatch.
ChronoValueIndicates the time elapsed (in milliseconds) since the call to ChronoStart.
CurrentDayReturns the number of the current day in the current month.
CurrentMonthReturns the number of the current month.
CurrentYearReturns the current year in integer format.
DateDifferenceCalculates the number of days between two dates.
DatePickerOpens the system date picker.
DateSysReturns or modifies the system date (current date defined on the current computer).
DateTimeByDefaultUsed to define the default value of Date, Time and DateTime variables.
DateTimeDifferenceCalculates the difference between two dates and times.
DateTimeLocalToTimeZoneConverts a local date and time to the date and time in a particular time zone.
DateTimeLocalToUTCConverts a local date and time (time zone, summer time, winter time) to UTC.
DateTimeTimeZoneToLocalConverts a date and time from a particular time zone to a local date and time.
DateTimeToEpochConverts a local datetime to Epoch format (number of time units since 01/01/1970 at 00h00 UTC).
DateTimeToRealConverts a date and time to an 8-byte real.
DateTimeToStringConverts a DateTime to string in the specified format.
DateTimeUTCToLocalConverts a UTC date and time to local time (time zone, summer time, winter time).
DateTimeValidChecks the validity of a date/time between January 01, 0001 at 0 hours 0 minutes 0 seconds 0 hundredths of a second and December 31, 9999 at 23 hours 59 minutes 59 seconds 99 hundredths of a second.
DateToDayReturns the day corresponding to a given date.
DateToDayInAlphaReturns the name of the day corresponding to a specified date.
DateToDayOfWeekReturns the day of the week that corresponds to a given date.
DateToDayOfYearReturns the day of the year corresponding to a given date.
DateToIntegerConverts a date to an integer.
DateToMonthInAlphaReturns the name of the month that corresponds to a specified date.
DateToStringConverts:
  • a date to a string in the specified format.
  • a date time to a string in the specified format.
DateToWeekNumberReturns the week number within the year that corresponds to the specified date.
DateValidChecks the validity of a date between January 01 0001 and December 31 9999.
New in version 2025
DayInYearToDate
Returns the date (in "YYYYMMDD" format) corresponding to a day number in the year.
DayNumberInAlphaReturns the name of the day of the week according to its number.
DurationToStringConverts a duration to a character string in the specified format.
EasterReturns the date of Easter for the specified year according to the western Christian calendar.
EpochToDateTimeConverts a date and a time in Epoch format (number of time units since 01/01/1970 at 00h00 UTC) to a local datetime.
FirstDayOfMonthReturns the first day of the month.
FirstDayOfWeekReturns the date of first day of the week (i.e., Monday).
FirstDayOfYearReturns the date of the first day of the year.
IntegerToDateConverts an integer into a date in YYYYMMDD format.
IntegerToDayReturns the day of the week corresponding to the specified date (this date is an integer).
IntegerToDayInAlphaReturns the name of the day corresponding to a specified date (this date is an integer).
IntegerToMonthInAlphaReturns the name of the month that corresponds to the specified date (this date is an integer).
IntegerToTimeConverts an integer into a time in HHMMSSCC format.
IntegerToWeekNumberReturns the week number within the year that corresponds to the specified date (this date is an integer).
LastDayOfMonthReturns the date of the last day for the specified month.
LastDayOfWeekReturns the date of the last day of the week corresponding to a given date.
LastDayOfYearReturns the date of the last day of the year.
LeapYearIndicates whether the specified year is a leap year or not.
MonthNumberInAlphaReturns the name of the month according to its number.
NowReturns or modifies the system time (current time defined for the current computer).
RealToDateTimeConverts an 8-byte real to a date and time.
StringToDateConverts a date in character string format to a date in YYYYMMDD format.
StringToDurationConverts a duration in character string format to a duration that can be used by a Duration variable.
StringToTimeConverts a time in character string format to a time in HHMMSSCC format that can be used by a Time variable.
SysDateTimeReturns or modifies the system date (current date and time defined on the current computer).
TimeDifferenceCalculates the difference between two times in hundredths of a second.
TimePickerOpens the system time picker.
TimeSysReturns or modifies the system time (current time defined for the current computer).
TimeToIntegerConverts a time to an integer.
TimeToStringConverts a time to a string in the specified format.
TimeValidChecks the time validity.
TodayReturns or modifies the system date (current date defined on the current computer).
TomorrowReturns the date of the day following the current day or a given date.
WeekNumberReturns the week number within the year that corresponds to the specified date (this date is a character string).
WeekToDateReturns the date of the Monday for the specified week and year.
YesterdayReturns the date of the day preceding the current day or a given date.
Related Examples:
Management of dates Unit examples (WEBDEV): Management of dates
[ + ] This example presents the use of the Date type of WLanguage and the use of the functions for handling the dates.
Calculating the date of Easter and an age Unit examples (WINDEV): Calculating the date of Easter and an age
[ + ] Calculating the date of Easter for a given year and calculating the age of a person at a given date.
The Chrono functions Unit examples (WINDEV): The Chrono functions
[ + ] Using the ChronoXXX functions.
These functions are used to calculate the time passed between the start (ChronoStart) and the end (ChronoEnd).
Management of dates Unit examples (WINDEV): Management of dates
[ + ] Using the Date type of WLanguage and the functions for handling dates.
Calculations on durations Unit examples (WINDEV): Calculations on durations
[ + ] Calculations on dates and times with the WLanguage functions:
- Calculate the duration between two moments (dates and times)
- Calculate a sum of durations
- Calculate an average of durations
WD Evaluation period Training (WINDEV): WD Evaluation period
[ + ] This example explains how to limit the use of an application to a given period (evaluation period).
The following topics are presented in this example:
1/ the protection of an application for a given duration
2/ the management of the registry

Summary of the example supplied with WINDEV:
When this example is started for the first time, it is activated for an evaluation period set to 5 days.
The information regarding the date when it was first started is stored in the registry and a control key is used to check whether this date was not modified by the end user. At the end of the evaluation period, the application is locked, unless the end user provides the code for unlocking the application
The Chrono functions Unit examples (WINDEV Mobile): The Chrono functions
[ + ] Using the WLanguage "Chrono" functions.
These functions are used to calculate the time passed between the start (ChronoStart) and the end (ChronoEnd).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/04/2024

Send a report | Local help