Get Current Time
Overview
Retrieves the current date and time with support for multiple formats, timezones, and locale-specific output.
Quick Start
Get current time in default format (ISO 8601):
bash
python3 get-current-time/scripts/get_time.py
Get time in a specific format:
bash
python3 get-current-time/scripts/get_time.py --format "%Y-%m-%d %H:%M:%S"
Get time in a specific timezone:
bash
python3 get-current-time/scripts/get_time.py --timezone "Asia/Shanghai"
Available Formats
| Format | Description | Example |
|---|---|---|
iso | ISO 8601 format (default) | 2025-01-15T14:30:00+08:00 |
date | Date only | 2025-01-15 |
time | Time only | 14:30:00 |
full | Full readable format | Wednesday, January 15, 2025 at 2:30 PM |
timestamp | Unix timestamp | 1736927400 |
Common Timezones
- •
Asia/Shanghai- China Standard Time - •
America/New_York- Eastern Time - •
America/Los_Angeles- Pacific Time - •
Europe/London- GMT/BST - •
Asia/Tokyo- Japan Standard Time - •
UTC- Coordinated Universal Time
Resources
scripts/get_time.py
Main script for retrieving current time. Supports custom formats and timezones via command-line arguments.