PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Validity of the time
  • Time format
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
TimeToString (Function)
In French: HeureVersChaîne
Formats the time passed in a parameter according to the specified format.
WEBDEV - Browser code In this version, the time passed in parameter is formatted according to the "HH:MM:SS:CC" format.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the 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.
Example
// Format the specified time according to the "HH:MM:SS:CC" format
TimeToString("12005956")   // Returns "12:00:59:56"
Left(TimeToString("12005956"), 5) // Returns "12:00"
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJavaPHPAjaxUser code (UMC)
// Format the time specified according to the format: "It is: HH h MM"
TimeToString(Now(), "It is: HH h MM") // Returns "It is: 12 h 32"
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 AppJavaPHPAjaxUser code (UMC)
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
<Result> = TimeToString(<Time> [, <Format>])
<Result>: Character string
Character string in the specified format.
<Time>: Character string (with quotes) or Time variable
Character string containing the 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).
<Format>: Optional character string (with quotes)
Format that must be applied to the time. This parameter corresponds to:
  • a character string (a sentence for example). The specific characters representing the different elements of the time (HH, MM, SS, CC or AP) will be automatically replaced by their value identified in the <Time> string. In this string, the characters:
    • HH represent the number of hours,
    • MM represent the number of minutes,
    • SS represent the number of seconds,
    • CC represent the number of hundredths of a second,
    • AP represent "AM" or "PM" (if "AM" is found in the format, the time is displayed over 12 hours).
  • Versions 17 and later
    the maskSystemTime constant. This constant allows you to directly use the mask used by the system time.
    WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This constant is not available. AndroidAndroid Widget Java This constant is not available.
    New in version 17
    the maskSystemTime constant. This constant allows you to directly use the mask used by the system time.
    WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This constant is not available. AndroidAndroid Widget Java This constant is not available.
    the maskSystemTime constant. This constant allows you to directly use the mask used by the system time.
    WEBDEV - Browser codeAndroidAndroid Widget JavaPHP This constant is not available. AndroidAndroid Widget Java This constant is not available.
If this parameter is not specified, the result is in HH:MM:SS:CC format.
WEBDEV - Browser code This syntax is not available in this version. The result is in HH:MM:SS:CC format.
Remarks

Validity of the time

The validity of the time passed in parameter is checked. A message is displayed if the time is invalid. The validity of a time can be checked by TimeValid.
Tip: To have a valid time in a string, the time must be entered in a Time edit control.

Time format

TimeToString is used to format a time returned by IntegerToTime or TimeSys. The result can be assigned to a text control for example.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment