time¶
Show current time or parse a timestamp.
Synopsis¶
Description¶
Display the current time in various formats, or parse a provided timestamp. Supports Unix timestamps and common date/time formats.
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--format |
-f |
Explicit input format (e.g., 2006-01-02, unix, unixmilli) |
|
--utc |
-u |
Show output in UTC only (suppress local time) | false |
Examples¶
Show current time:
Parse Unix timestamp:
Parse Unix milliseconds:
Parse ISO 8601 date:
Parse date only:
Parse with custom format:
Output in UTC only:
Supported Input Formats¶
The tool auto-detects these formats:
- Unix timestamp (seconds, milliseconds, microseconds, nanoseconds)
- RFC3339:
2006-01-02T15:04:05Z07:00 - Date and time:
2006-01-02 15:04:05 - Date only:
2006-01-02 - RFC1123:
Mon, 02 Jan 2006 15:04:05 MST
Special format names for -f:
unix- Unix secondsunixmilli- Unix millisecondsunixmicro- Unix microsecondsunixnano- Unix nanoseconds