Lipi Reference Lipi

Functions

str.format_time()

Renders a time value as text. The format is a specimen date rather than a set of escapes: write out 2006-01-02 15:04:05 in the arrangement you want. The optional timezone defaults to UTC. Note the unit. This function reads its first argument as seconds, while `time`, `time_close`, `timenow` and `timestamp` all produce milliseconds, so divide by a thousand first. Passing a time value straight in reports a wrong date and raises nothing.

Syntax · 1 of 4

                str.format_time(const int time_value, const string format, const string timezone) → const string
              

Arguments

time_value required const int the time to render, as an int
format required const string the format the result is written in
timezone const string optional; the timezone the result is expressed in

Return Type

const string

Syntax · 2 of 4

                str.format_time(input int time_value, input string format, input string timezone) → input string
              

Arguments

time_value required input int the time to render, as an int
format required input string the format the result is written in
timezone input string optional; the timezone the result is expressed in

Return Type

input string

Syntax · 3 of 4

                str.format_time(simple int time_value, simple string format, simple string timezone) → simple string
              

Arguments

time_value required simple int the time to render, as an int
format required simple string the format the result is written in
timezone simple string optional; the timezone the result is expressed in

Return Type

simple string

Syntax · 4 of 4

                str.format_time(series int time_value, series string format, series string timezone) → series string
              

Arguments

time_value required series int the time to render, as an int
format required series string the format the result is written in
timezone series string optional; the timezone the result is expressed in

Return Type

series string