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
| Abbreviated weekday name |
| Full weekday name |
| Abbreviated month name |
| Full month name |
| Date and time, as in Wed Oct 6 11:45:56 1993 |
| Day of the month (01–31) |
| Hour (00–23) |
| Hour (01–12) |
| Day (001–366) |
| Month (01–12) |
| Minute (00–59) |
| A.M. or P.M. |
| Second (00–61) |
| Day (1–7, Monday is first day of week) |
| Week (00–53, first Sunday is first day of week one) |
| Week (01–53, ISO 8601 style) |
| Day (0–6) |
| Week (00–53, first Monday is first day of week one) |
| Date and time, as in Wed Oct 6 1993 |
| Time, as in 23:59:59 |
| Year (00–99) |
| Year, as in 1993 |
| 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.