Home | Sign in | English UK
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Formats the specified duration into the specified format. The duration is handled in character string format.
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.
WEBDEV - Server codeWEBDEV - Browser codeAjaxStored 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 = MyDuration.ToString(durationCenti) // Res = "001152800"
// Custom formatting
Res = MyDuration.ToString("D-HH:MM")    // Res =  "0-01:15"
<Result> = <Duration>.ToString(<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).
<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. Here are the characters used in this string:
    • + 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
The direct assignment <String> = <Duration> is equivalent to <Duration type>.ToString used with the "+DHHMMSSLLL" format.
Component : wd250std.dll
Minimum version required
  • Version 24
This page is also available for…
Click [Add] to post a comment