# man > date

---
type: CommandReference
command: date
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `date +%c` — display current date in default locale format
- `date -u +%Y-%m-%dT%H:%M:%S%Z` — display current date in UTC, ISO 8601
- `date +%s` — display current date as Unix timestamp
- `date -d @1473305798` — convert Unix timestamp to default format
- `date -d "2018-09-01 00:00" +%s -u` — convert given date to Unix timestamp
- `date --rfc-3339=seconds` — display current date in RFC 3339 format
- `sudo date 093023592021.59` — set system date (MMDDhhmmYYYY.ss)
- `date +%V` — display current ISO week number

## Name

`date` — print or set the system date and time

## Synopsis

shell
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
## Options

### Display options

- `-d, --date STRING` — display time described by STRING, not `now`
- `-f, --file DATEFILE` — like `--date` once for each line of DATEFILE
- `-I[FMT], --iso-8601[=FMT]` — output ISO 8601 date/time; FMT can be `date`, `hours`, `minutes`, `seconds`, `ns`
- `-R, --rfc-email` — output RFC 5322 format (e.g., Mon, 14 Aug 2006 02:34:56 -0600)
- `--rfc-3339=FMT` — output RFC 3339 format; FMT = `date`, `seconds`, or `ns`
- `-r, --reference FILE` — display last modification time of FILE
- `-u, --utc, --universal` — print or set Coordinated Universal Time (UTC)
- `--debug` — annotate parsed date and warn about questionable usage
- `--help` — display help and exit
- `--version` — output version information and exit

### Format specifiers

`FORMAT` controls the output. Interpreted sequences (common):

| Sequence | Description |
|----------|-------------|
| `%%` | literal `%` |
| `%a` | locale's abbreviated weekday (e.g., Sun) |
| `%A` | locale's full weekday (e.g., Sunday) |
| `%b` | locale's abbreviated month (e.g., Jan) |
| `%B` | locale's full month (e.g., January) |
| `%c` | locale's date and time (e.g., Thu Mar 3 23:05:25 2005) |
| `%C` | century (e.g., 20) |
| `%d` | day of month (01–31) |
| `%D` | date; same as `%m/%d/%y` |
| `%F` | full date; like `%Y-%m-%d` |
| `%H` | hour (00–23) |
| `%I` | hour (01–12) |
| `%j` | day of year (001–366) |
| `%m` | month (01–12) |
| `%M` | minute (00–59) |
| `%N` | nanoseconds (000000000–999999999) |
| `%p` | locale's AM/PM |
| `%r` | locale's 12-hour clock time |
| `%s` | seconds since 1970-01-01 00:00:00 UTC |
| `%S` | second (00–60) |
| `%T` | time; same as `%H:%M:%S` |
| `%u` | day of week (1=Monday, 7=Sunday) |
| `%V` | ISO week number (01–53) |
| `%w` | day of week (0=Sunday, 6=Saturday) |
| `%x` | locale's date representation |
| `%X` | locale's time representation |
| `%y` | last two digits of year (00–99) |
| `%Y` | year |
| `%z` | `+hhmm` numeric time zone |
| `%:z` | `+hh:mm` numeric time zone |
| `%Z` | alphabetic time zone abbreviation (e.g., EDT) |

**Padding flags** (after `%`): `-` (no pad), `_` (space pad), `0` (zero pad), `+` (zero pad with `+` for >4‑digit years), `^` (upper case), `#` (opposite case). An optional field width and optional modifier `E` or `O` may follow.

### Setting the date

- `-s, --set STRING` — set time described by STRING
- To set directly: `date MMDDhhmm[[CC]YY][.ss]` (requires superuser privileges typically)

## Examples

shell
# Convert seconds since epoch to a date
date --date='@2147483647'

# Show time on the west coast of the US (use tzselect to find TZ)
TZ='America/Los_Angeles' date

# Show local time for 9AM next Friday on the west coast
date --date='TZ="America/Los_Angeles" 09:00 next Fri'

# Display current date in ISO 8601 with seconds
date --iso-8601=seconds

# Display current date in RFC 3339 with nanoseconds
date --rfc-3339=ns

# Set system date to 09:30:23 on 30 September 2021, 59 seconds
sudo date 093023592021.59
## See Also

- [tzselect(1)](https://www.chedong.com/phpMan.php/man/tzselect/1/markdown)
- Full documentation: <https://www.gnu.org/software/coreutils/date> or `info '(coreutils) date invocation'`