Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

time

Subcommands

SubcommandDescriptionSyntax
nowReturns the current date and timenow()
strftimeFormats a timestamp into a stringstrftime(<expr>, <expr>)
strptimeAttempts to parse a string into a timestampstrptime(<expr>, <expr>)

Examples

now

Returns the current date and time as a timestamp:

| eval ts=now()

strftime

For a field timestamp containing epoch seconds 1704067200, this example formats it as 2024:

| eval formatted=strftime(timestamp, "%Y")

strptime

For a string "2024-01-01T00:00:00Z", this example parses it into a timestamp using ISO8601 format:

| eval parsed=strptime("2024-01-01T00:00:00Z", "%+")