PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns or modifies the system time (current time defined for the current computer).
Note: This function is identical to Now.
Example
Res = TimeSys()        // Res = "15332105"
Res = TimeToString(TimeSys())   // Res = "15:33:21:05"
CurrentTime = Left(TimeSys(), 4)  // CurrentTime = "1533"
WEBDEV - Server codeAjax
// Changes the system time and displays the new time
TimeSys("17280000")
Info(TimeSys())
WEBDEV - Server codePHPAjax
TodaysDate is Date = DateSys()
EDT_EditDate = DateToDayInAlpha(TodaysDate) + " " + TodaysDate..Day + ...
" " + DateToMonthInAlpha(TodaysDate) + " at " + ...
TimeToString(TimeSys(), "HH:MM:SS")
// The EDT_EditDate control contains for example: Monday 20 August at 14:44:17
Syntax

Finding out the system time Hide the details

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

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 year, MM to month, DD to day, HH to hour, 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 year, MM to month, DD to day, HH to hour, 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 year, MM to month, DD to day, HH to hour, 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 format can be defined with DateToString, Right, Left, etc.
  • The HHMMSSCC format was chosen because it allows you to compare two times to the hundredth of a second.
  • WEBDEV - Server code The system time corresponds to the current time defined for the server.
  • WEBDEV - Browser codePHP In this version, TimeSys can only be used to return the system time (current time defined for the current computer or on the browser computer).
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
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment