ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The following functions are used to handle dates and times, using prefix syntax:
<Chrono>.EndStops a stopwatch and returns the time elapsed (in milliseconds) since the start of timing (call to <Chrono>.Start).
<Chrono>.PausePauses a stopwatch in order to measure the time spent on a process.
<Chrono>.ResetStops and resets a running stopwatch.
<Chrono>.ResumeResumes a stopwatch previously stopped by <Chrono>.Fin or <Chrono>.Pause.
<Chrono>.StartStarts a stopwatch to measure the duration of a process (in milliseconds) and resets a running stopwatch.
<Date type>.ToDayReturns the day that corresponds to a given date.
<Date type>.ToDayInAlphaReturns the name of the day that corresponds to a specified date.
New in version 2024
<Date type>.ToDayOfYear
Returns the day of the year corresponding to a given date.
<Date type>.ToIntegerConverts a date to an integer.
<Date type>.ToMonthInAlphaReturns the name of the month that corresponds to a specified date.
<Date type>.ToStringConverts:
  • a date to a string in the specified format.
  • a date time to a string in the specified format.
<Date type>.ToWeekNumberReturns the week number within the year that corresponds to the specified date.
<DateTime type>.ToEpochConverts a local datetime to Epoch format (number of time units since 01/01/1970 at 00h00 UTC).
<DateTime type>.ToRealConverts a date and time to an 8-byte real.
<DateTime type>.ToStringConverts a DateTime to string in the specified format.
<Duration type>.ToStringConverts a duration to a character string in the specified format.
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).
UWA Stopwatch Universal Apps (WINDEV Mobile): UWA Stopwatch
[ + ] This example explains how to create a stopwatch for a mobile device with WINDEV Mobile.
In this example, a timer is used to display the hands of the stopwatch and to display the time passed on a regular basis.
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/06/2024

Send a report | Local help