PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
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
Returns or modifies the system time (current time defined for the current computer).
Remark: This function is equivalent to Now.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 25 and later
IOS Widget This function is now available in iOS widget mode.
Apple Watch This function is now available for Apple Watch applications.
New in version 25
IOS Widget This function is now available in iOS widget mode.
Apple Watch This function is now available for Apple Watch applications.
IOS Widget This function is now available in iOS widget mode.
Apple Watch This function is now available for Apple Watch applications.
Example
Res = TimeSys()        // Res = "15332105"
Res = TimeToString(TimeSys())   // Res = "15:33:21:05"
HeureAct = Left(TimeSys(), 4)    // HeureAct = "1533"
WINDEVReports and QueriesUniversal Windows 10 AppUser code (UMC)
// Afficher l'heure actuelle dans le champ HeureActuelle
 
// -- Code d'initialisation d'une fenêtre/page
// Appeler toutes les secondes la procédure "Horloge"
TimerSys("Horloge", 100, 1)
// -- Procédure Horloge
PROCÉDURE Horloge()
HeureActuelle = TimeToString(TimeSys())
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax
// Change l'heure système et affiche la nouvelle heure
TimeSys("17280000")
Info(TimeSys())
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget JavaUser code (UMC)PHPAjax
DateAujourdhui is Date = DateSys()
SAI_SaisieDate = DateToDayInAlpha(DateAujourdhui) + " " + DateAujourdhui.Day + ...
" " + DateToMonthInAlpha(DateAujourdhui) + " à " + ...
TimeToString(TimeSys(), "HH:MM:SS")
// Le champ SAI_SaisieDate contient par exemple: Lundi 20 Août à 14:44:17
Syntax

Getting the system time Hide the details

<Result> = TimeSys()
<Result>: Character string or Time variable
System time in HHMMSSCC format (HH corresponds to hours, MM to minutes, SS to seconds and CC to hundredths of a second).
WEBDEV - Browser code System time in HHMMSSCCC format (HH corresponds to hours, MM to minutes, SS to seconds and CCC to hundredths of a second).
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)Ajax

Modifying the system time Hide the details

TimeSys(<New time>)
<New time>: Character string, Date or DateTime variable
New system time. This time can correspond to:
  • a character string in HHMMSSCC format (HH corresponds to hours, MM to minutes, SS to seconds and CC to hundredths of a second).
  • Versions 24 and later
    a character string in YYYYMMDDHHmmSSCC format (YYYY corresponds to the year, MM to the month, DD to the day, HH to hours, mm to minutes, SS to seconds and CC to hundredths of a second). In this case, only the time is taken into account.
    New in version 24
    a character string in YYYYMMDDHHmmSSCC format (YYYY corresponds to the year, MM to the month, DD to the day, HH to hours, mm to minutes, SS to seconds and CC to hundredths of a second). In this case, only the time is taken into account.
    a character string in YYYYMMDDHHmmSSCC format (YYYY corresponds to the year, MM to the month, DD to the day, HH to hours, mm to minutes, SS to seconds and CC to hundredths of a second). In this case, only the time is taken into account.
  • a Time variable.
  • Versions 24 and later
    a DateTime variable. In this case, only the time is taken into account.
    New in version 24
    a DateTime variable. In this case, only the time is taken into account.
    a DateTime variable. In this case, only the time is taken into account.
Remarks
  • Caution: To modify the system time, you must have the administrator rights on the current computer.
  • To get the time in a format other than HHMMSSCC, the string must be formatted using DateToString, Right, Left, etc.
  • The HHMMSSCC format was chosen because it allows you to compare two times with hundredths-of-a-second accuracy.
  • WEBDEV - Server code The system time corresponds to the current time defined on the server.
  • WEBDEV - Browser codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystPHP In this version, the TimeSys function only allows to return the system time (current time defined for the current station or on the browser station).
  • Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst In simulation mode, the time used is the time on the PC where the simulation is run. At runtime, the time of the mobile device is used.
Related Examples:
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
Business / UI classification: Neutral code
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment