Function StringToMoment(Format, Unit, ReferenceDate, Timeslot)


The function StringToMoment converts a given time string (in a free time format) to the elapsed time with a respect to a specific reference date.

     Format,             ! (input) a string expression
     Unit,               ! (input) a time unit
     ReferenceDate,      ! (input) a string expression
     Timeslot            ! (input) a string expression



A string that holds the date and time format used in the fourth argument Timeslot. Valid format strings are described in Format of Time Slots and Periods


The time unit that is used to return the elapsed time.


A string that holds the begin date using the fixed format for date and time, see paragraph Reference date format of the Language Reference.


A string representing a specific date and time moment using the format specified in the first argument Format.

Return Value

The result of StringToMoment is the elapsed time in unit between reference-date and date.

See also

The functions MomentToString, CurrentToMoment.