|
|
|
|
|
StringToDuration (Function) In french: ChaîneVersDurée Converts a duration in character string format to a duration that can be used by a Duration variable. Remarks: - This function is mainly used to assign the result of DateTimeDifference to a Duration variable.
- The direct assignment <Duration variable> = <String> is equivalent to using StringToDuration with the "+DHHMMSSCCC" format.
sDiff is string
sDiff = DateTimeDifference(sDébut, sFin)
dDurée is Duration
dDurée = StringToDuration(sDiff, durationCenti)
sMaChaîne is string = "La durée est de 3 jours, 13 heures, 45 minutes."
dDurée is Duration
dDurée = StringToDuration(sMaChaîne, "La durée est de J jours, HH heures, MM minutes.")
Trace(dDurée)
Syntax
<Result> = StringToDuration(<String> , <Format>)
<Result>: Duration variable Duration in a format recognized by the Duration variables. <String>: Character string Duration in the format specified in <Format>. <Format>: Character string Format of the duration to convert. This format corresponds to:- a character string (a sentence for example). The characters that represent the different elements of the duration (D, HH, MM, SS or CCC) will be automatically replaced with the value in the <String> parameter. In this string:
- D represents the number of days,
- HH represents the number of hours,
- MM represents the number of minutes,
- SS represents the number of seconds,
- CCC represents the number of milliseconds.
- one of the following constants:
| | durationCenti | Format used: "+JHHMMSSCC": creates a duration from the format of the result of the DateTimeDifference function | durationMilli | Format used: "+JHHMMSSCCC". |
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|