Name

timestamp

timestamp [options]

Return a timestamp. With no arguments, returns the number of seconds since the start of the epoch.

Options

-format format-string

Return time formatted using a format string. The string follows the format of the POSIX strftime function, as described below. This command is deprecated; use the Tcl clock command instead.

-seconds source

Return a timestamp based on the time source, expressed as a number of seconds since the start of the epoch.

-gmt

Use Greenwitch Mean Time (UTC) rather than the local time zone.

Format Strings

%a

Abbreviated weekday name

%A

Full weekday name

%b

Abbreviated month name

%B

Full month name

%c

Date and time, as in Wed Oct 6 11:45:56 1993

%d

Day of the month (01–31)

%H

Hour (00–23)

%I

Hour (01–12)

%j

Day (001–366)

%m

Month (01–12)

%M

Minute (00–59)

%p

A.M. or P.M.

%S

Second (00–61)

%u

Day (1–7, Monday is first day of week)

%U

Week (00–53, first Sunday is first day of week one)

%V

Week (01–53, ISO 8601 style)

%w

Day (0–6)

%W

Week (00–53, first Monday is first day of week one)

%x

Date and time, as in Wed Oct 6 1993

%X

Time, as in 23:59:59

%y

Year (00–99)

%Y

Year, as in 1993

%Z

Time zone (or nothing if not determinable)

%%

A bare percent sign

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.