PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Formats the specified duration into the specified format. The duration is handled in character string 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 20 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 20
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
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
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesAndroidAndroid Widget Windows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)Stored procedures
// Start time and end time
StartTime is Time = "125324"
EndTime is Time = "140852"
// Calculate the duration
MyDuration is Duration = EndTime - StartTime
// Format the duration in order to get a result in the same format as DateTimeDifference
Res = DurationToString(MyDuration, durationCenti) // Res = "001152800"
// Custom formatting
Res = DurationToString(MyDuration, "D-HH:MM")    // Res =  "0-01:15"
Syntax
<Result> = DurationToString(<Duration> , <Format>)
<Result>: Character string
Character string in the specified format.
<Duration>: Duration variable
  • Duration variable containing the duration in "+DHHMMSSLLL" format (D corresponds to the number of days, HH to the hours, MM to the minutes, SS to the seconds and LLL to the milliseconds).
  • Versions 23 and later
    Indication of duration in clear (1 d 2 h 3 min 10 s 10 ms for example, where d corresponds to the number of days, h to the hours, min to the minutes, s to the seconds and ms to the milliseconds).
    New in version 23
    Indication of duration in clear (1 d 2 h 3 min 10 s 10 ms for example, where d corresponds to the number of days, h to the hours, min to the minutes, s to the seconds and ms to the milliseconds).
    Indication of duration in clear (1 d 2 h 3 min 10 s 10 ms for example, where d corresponds to the number of days, h to the hours, min to the minutes, s to the seconds and ms to the milliseconds).
PHP The Duration type does not exist in PHP. Therefore, this parameter must necessarily be a character string.
<Format>: Character string or constant
Format to apply to the duration. This parameter can correspond to:
  • a character string (a sentence for example). The specific characters representing the different elements of the duration (D, HH, MM, SS or LLL) will be automatically replaced by their value identified in the <Duration> string. In this string, the characters:
    • + is used to take the negative numbers into account,
    • D represents the number of days,
    • HH represent the number of hours,
    • MM represent the number of minutes,
    • SS represent the number of seconds,
    • LLL represent the number of milliseconds.
  • one of the following constants:
    durationMilliFormat used: "+DHHMMSSLLL"
    durationCentiFormat used: "+DHHMMSSLL". This format allows you to retrieve the result in the format used by DateTimeDifference
Remarks
The direct assignment <String> = <Duration> is equivalent to DurationToString used with the "+DHHMMSSLLL" format.
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