-
Notifications
You must be signed in to change notification settings - Fork 87
PluginDatetime
Fábio Luciano edited this page Dec 27, 2025
·
2 revisions
Display current date/time with advanced formatting options and timezone support.
14:30 # time format
24/12 # date format
24/12 14:30 # datetime format (default)
Tue, 24 Dec 14:30 # full format
W52 24/12 14:30 # with week number
| Property | Value |
|---|---|
| Platform | macOS, Linux, BSD, WSL |
| Dependencies | None (uses built-in date command) |
| Content Type | dynamic |
| Presence | always |
No dependencies required - uses system date command.
# Enable plugin
set -g @powerkit_plugins "datetime"# Enable plugin
set -g @powerkit_plugins "datetime"
# Format (preset or custom strftime)
set -g @powerkit_plugin_datetime_format "datetime"
# Secondary timezone
set -g @powerkit_plugin_datetime_timezone "America/New_York"
# Show ISO week number
set -g @powerkit_plugin_datetime_show_week "false"
# Separator between elements
set -g @powerkit_plugin_datetime_separator " "
# Icon
set -g @powerkit_plugin_datetime_icon ""
# Cache duration (seconds)
set -g @powerkit_plugin_datetime_cache_ttl "5"
# Only show on threshold (not applicable for datetime - always visible)
set -g @powerkit_plugin_datetime_show_only_on_threshold "false"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_datetime_format |
string | datetime |
Format preset or custom strftime |
@powerkit_plugin_datetime_timezone |
string | `` | Secondary timezone to display (e.g., America/New_York) |
@powerkit_plugin_datetime_show_week |
bool | false |
Show ISO week number prefix |
@powerkit_plugin_datetime_separator |
string | |
Separator between datetime elements |
@powerkit_plugin_datetime_icon |
icon | `` | Plugin icon |
@powerkit_plugin_datetime_cache_ttl |
number | 5 |
Cache duration in seconds |
@powerkit_plugin_datetime_show_only_on_threshold |
bool | false |
Only show when threshold exceeded (N/A for datetime) |
| State | Condition | Visibility |
|---|---|---|
active |
Always active | Always visible |
| Level | Condition | Color |
|---|---|---|
ok |
Always | Green |
| Context | Description | Time Range |
|---|---|---|
morning |
Morning hours | 06:00 - 11:59 |
afternoon |
Afternoon hours | 12:00 - 17:59 |
evening |
Evening hours | 18:00 - 21:59 |
night |
Night hours | 22:00 - 05:59 |
| Preset | Example | Description |
|---|---|---|
time |
14:30 |
24-hour time |
time-seconds |
14:30:45 |
24-hour with seconds |
time-12h |
02:30 PM |
12-hour with AM/PM |
time-12h-seconds |
02:30:45 PM |
12-hour with seconds and AM/PM |
| Preset | Example | Description |
|---|---|---|
date |
24/12 |
Day/Month (EU format) |
date-us |
12/24 |
Month/Day (US format) |
date-full |
24/12/2024 |
Full date (EU) |
date-full-us |
12/24/2024 |
Full date (US) |
date-iso |
2024-12-24 |
ISO 8601 date |
| Preset | Example | Description |
|---|---|---|
datetime |
24/12 14:30 |
Date + time (EU, default) |
datetime-us |
12/24 02:30 PM |
Date + time (US 12h) |
weekday |
Tue 14:30 |
Short weekday + time |
weekday-full |
Tuesday 14:30 |
Full weekday + time |
full |
Tue, 24 Dec 14:30 |
Weekday, date, time |
full-date |
Tue, 24 Dec 2024 |
Weekday + full date |
iso |
2024-12-24T14:30:45 |
ISO 8601 datetime |
Use any valid strftime format string:
# Custom format examples
set -g @powerkit_plugin_datetime_format "%Y-%m-%d %H:%M" # 2024-12-24 14:30
set -g @powerkit_plugin_datetime_format "%A, %B %d" # Tuesday, December 24
set -g @powerkit_plugin_datetime_format "%I:%M %p" # 02:30 PM
set -g @powerkit_plugin_datetime_format "%a %d %b %Y %H:%M:%S" # Tue 24 Dec 2024 14:30:45| Code | Example | Description |
|---|---|---|
%Y |
2024 |
Four-digit year |
%y |
24 |
Two-digit year |
%m |
12 |
Month (01-12) |
%B |
December |
Full month name |
%b |
Dec |
Short month name |
%d |
24 |
Day of month (01-31) |
%A |
Tuesday |
Full weekday name |
%a |
Tue |
Short weekday name |
%H |
14 |
Hour 24-hour (00-23) |
%I |
02 |
Hour 12-hour (01-12) |
%M |
30 |
Minute (00-59) |
%S |
45 |
Second (00-59) |
%p |
PM |
AM/PM |
set -g @powerkit_plugins "datetime"set -g @powerkit_plugins "datetime"
set -g @powerkit_plugin_datetime_format "time-12h"set -g @powerkit_plugins "datetime"
set -g @powerkit_plugin_datetime_format "iso"
set -g @powerkit_plugin_datetime_show_week "true"set -g @powerkit_plugins "datetime"
set -g @powerkit_plugin_datetime_format "time"
set -g @powerkit_plugin_datetime_timezone "America/New_York"
set -g @powerkit_plugin_datetime_separator " | "Output: 20:30 | 14:30 (Local | NYC)
set -g @powerkit_plugins "datetime"
set -g @powerkit_plugin_datetime_format "full"Output: Tue, 24 Dec 14:30
set -g @powerkit_plugins "datetime"
set -g @powerkit_plugin_datetime_format "%H:%M:%S"Output: 14:30:45
Check your system timezone:
# View current timezone
date +%Z
# List available timezones
ls /usr/share/zoneinfo/
# Set system timezone (Linux)
sudo timedatectl set-timezone America/New_York
# Set system timezone (macOS)
sudo systemsetup -settimezone America/New_York- Verify strftime format syntax is correct
- Test format directly:
date +"your-format" - Some format codes may not be supported on all platforms
Different systems use different week numbering standards:
- ISO week (
%V): Week 01 is the first week with Thursday - Simple week (
%W): Week 01 is the first week with Monday - Plugin attempts
%Vfirst, falls back to%W
- PluginTimezones - Display multiple timezones simultaneously
- PluginUptime - System uptime display
- PluginPomodoro - Pomodoro timer