A lightweight Bash script that outputs the current date and time in ISO 8601 format including the timezone offset. This utility provides a consistent and standardized timestamp useful for logging, automation, and scripting workflows.
Features
- Outputs current date and time in the format:
YYYY-MM-DDTHH:MM:SS±HH:MM - Uses standard Bash and the Unix
datecommand - Minimal dependencies and easy to integrate into other scripts
Tech Stack
- Shell scripting (Bash)
- Unix
datecommand
Getting Started
Prerequisites
- Bash shell
datecommand (available on most Unix-like systems)
Installation
Clone or download this repository. Save the script file current-time.sh to your local machine.
Usage
Make the script executable:
chmod +x current-time.sh
Run the script:
./current-time.sh
Example output:
date = "2024-07-13T14:27:45-06:00"
Project Structure
current-time.sh- The main Bash script that outputs the current time.README.md- This readme file.index.md- Additional documentation with usage instructions and metadata.
Future Work / Roadmap
- Add support for alternative output formats such as UTC or Unix timestamp.
- Introduce command-line options to customize output format and timezone.
- Improve portability across different Unix-like systems and shells.
- Add automated tests to verify output format consistency.
This project is provided as-is without warranty. You may modify and use it as needed.