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
Converts a time in character string format to a time in HHMMSSCC format that can be used by a Time variable.
Example
MyTime is Time
MyTime = StringToTime("12:10:25:78")  // MyTime = "12102578"
Syntax
<Result> = StringToTime(<String> [, <Format>])
<Result>: Character string or Time variable
  • Time in HHMMSSCC format (HH corresponds to hours, MM to minutes, SS to seconds and CC to hundredths of a second).
  • Empty string ("") if a problem occurs.
<String>: Character string
Time in the format specified in <Format>.
<Format>: Optional character string
Format of the string that must be converted to time. You can use:
  • The specific characters representing the different elements of the time (HH, MM, SS, CC or AP) will be automatically replaced with their value identified in <String>.
    In this string:
    • HH represents the number of hours,
    • MM represents the number of minutes,
    • SS represents the number of seconds,
    • CC represents the number of hundredths of a second,
    • AP represents "AM" or "PM" (if "AP" is used, the time is displayed in 12-hour format).
  • The following constant:
    maskSystemTimeAllows you to directly use the mask used by the system time. This mask depends on the configuration of the project.
    To display the time settings of the project:
    1. On the "Project" tab, in the "Project" group, click "Description". The description window of the project is displayed.
    2. In the "Languages" tab, select the "Time" tab. You have the ability to use the Windows options or specific parameters.
If this parameter is not specified, the HH:MM:SS:CC format is used by default.
Business / UI classification: Neutral code
Component: wd290std.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Hour String must be two digits to work
Most time strings in the US do not use two digits for the hour if < 10. This routine will not convert properly if this is the case (it should).
Peter
30 Aug. 2023

Last update: 05/26/2022

Send a report | Local help