Equinox Online Help - Language Reference - A to Z

Home

StrTime

Applies to
SyntaxStrtime(TimeExpression, FormatExpression)
Action[Function] Returns a time value as a string.
ScopeUsable anywhere.
Notes

This function returns TimeExpression as a string. FormatExpression is a string comprising style identifiers that format the returned string. FormatExpression recognises the following identifiers.

IdentifierStyle
%am or %AMam, pm or AM, PM suffix
%24h or %024H24-hour clock format, eg 1, 24 or 01, 24
%12h or %012H12-hour clock format, eg 1, 12 or 01, 12
%h or %0hInclude hours (24-hour clock format)
%m or %0mInclude minutes
%s or %0sInclude seconds

You can include any number of these identifiers in FormatExpression. Any other characters appearing in FormatExpression, or any characters preceded by a back-slash, are added to the returned string.

CategoryConversions
See Also Asc, Card, ChoosePrinter, HexNum, HexStr, Lowercase, Ord, Str, StrCase, StrDate, Uppercase
Example

In the following example, the notes show what is printed (in the Print window) by each statement.

| 1:46 pm
Print Strtime (Now, "%12h:%0m %am")

| 01:06:42 am
Print Strtime (Now, "%012h:%0m:%0s %am")