Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

Releases: ThatGuyCodes605/BetterDate

v1.8

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 17 Jan 12:18
0f89a8e

Installation Linux MacOS and BSD

make
sudo make install

Installation Windows (you got to have GNUMake installed)

make

Full Changelog: v1.7...v1.8

v1.7

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 16 Jan 11:27
4cf9a2a

Features

  • ⏰ Real-time clock with configurable precision (milliseconds, microseconds, nanoseconds)
  • 🕐 Both 24-hour (default) and 12-hour format support with AM/PM
  • 🌍 Timezone support - view time in any timezone worldwide
  • 📅 Unix epoch timestamp display (optional)
  • 🇺🇸 US date format support - switch between DD/MM/YYYY and MM/DD/YYYY
  • ⏱️ Built-in stopwatch - countdown timer with alarm beeps
  • 🎛️ Customizable display - hide date, epoch, seconds, or milliseconds
  • 🖥️ Clean, in-place updating display without flickering or scrolling
  • ⚡ Efficient - automatically adjusts update rate based on precision level
  • 🛑 Graceful exit handling with Ctrl+C
  • 🐧 Multi-platform support (Linux, macOS, all BSDs, Windows)
  • 📖 No external dependencies

Platform Support

Works on Linux (full nanosecond precision), macOS (microsecond precision), FreeBSD, OpenBSD, NetBSD, DragonflyBSD, and Windows (via MinGW/Cygwin/MSYS2).

v1.6

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 16 Jan 00:13
384e904

BetterDate Wiki

Home

BetterDate is an improved version of the standard Unix date command. It's a feature-rich terminal-based clock written in C that displays real-time updates with configurable precision (milliseconds, microseconds, or nanoseconds), timezone support, customizable date/time formats, and a built-in stopwatch timer.

Features

  • ⏰ Real-time clock with configurable precision (milliseconds, microseconds, nanoseconds)
  • 🕐 Both 24-hour (default) and 12-hour format support with AM/PM
  • 🌍 Timezone support - view time in any timezone worldwide
  • 📅 Unix epoch timestamp display (optional)
  • 🇺🇸 US date format support - switch between DD/MM/YYYY and MM/DD/YYYY
  • ⏱️ Built-in stopwatch - countdown timer with alarm beeps
  • 🎛️ Customizable display - hide seconds, hide milliseconds, show high precision
  • 🖥️ Clean, in-place updating display without flickering or scrolling
  • ⚡ Efficient - automatically adjusts update rate based on precision level
  • 🛑 Graceful exit handling with Ctrl+C
  • 🐧 Multi-platform support (Linux, macOS, all BSDs, Windows)
  • 📖 No external dependencies

Platform Support

Works on Linux (full nanosecond precision), macOS (microsecond precision), FreeBSD, OpenBSD, NetBSD, DragonflyBSD, and Windows (via MinGW/Cygwin/MSYS2).

Example Output

Default (DD/MM/YYYY, milliseconds):

Epoch: 1737000000
Date: 15/01/2026  Time: 18:41:13.123

US format (MM/DD/YYYY):

Epoch: 1737000000
Date: 01/15/2026  Time: 18:41:13.123

12-hour with no milliseconds:

Epoch: 1737000000
Date: 15/01/2026  Time: 06:41:13 PM

No seconds (HH:MM only):

Epoch: 1737000000
Date: 15/01/2026  Time: 18:41

With nanoseconds:

Epoch: 1737000000
Date: 15/01/2026  Time: 18:41:13.123.456.789

Stopwatch:

Stopwatch started for 5.000000 minutes. Press Ctrl+C to stop.
Time left: 04:59

All displays refresh smoothly in place.


Installation

Quick Install (from source)

# Clone the repository
git clone https://github.com/ThatGuyCodes605/BetterDate.git
cd BetterDate

# Build and install
make
sudo make install

The program will be installed to /usr/local/bin/betterdate.

Uninstall

cd BetterDate
sudo make uninstall

Usage

Basic Usage

Default display (24-hour, DD/MM/YYYY, milliseconds, with epoch):

betterdate

12-hour format with AM/PM:

betterdate -12

US date format (MM/DD/YYYY):

betterdate -US

Hide milliseconds:

betterdate -NM

Output: Time: 18:41:13

Hide seconds:

betterdate -NS

Output: Time: 18:41

Microseconds precision:

betterdate -ms

Output: Time: 18:41:13.123.456

Nanoseconds precision:

betterdate -ns

Output: Time: 18:41:13.123.456.789

Hide epoch timestamp:

betterdate -ne

Change timezone:

betterdate -tz UTC
betterdate -tz America/New_York
betterdate -tz Europe/London
betterdate -tz Asia/Tokyo

Start stopwatch:

betterdate -sw 5      # 5 minutes
betterdate -sw 0.5    # 30 seconds
betterdate -sw 0.1    # 6 seconds

Show help:

betterdate -h
betterdate --help

Show version:

betterdate -v
betterdate --version

Combining Options

You can combine multiple flags:

# 12-hour US format with no milliseconds in Tokyo
betterdate -12 -US -NM -tz Asia/Tokyo

# 24-hour UTC with nanoseconds, no epoch
betterdate -tz UTC -ns -ne

# 12-hour format with no seconds
betterdate -12 -NS

# US format with microseconds and no epoch
betterdate -US -ms -ne

Available Flags

Flag Description Example
-12 Use 12-hour format with AM/PM betterdate -12
-ne Hide epoch timestamp betterdate -ne
-ms Show microseconds (milliseconds + microseconds) betterdate -ms
-ns Show nanoseconds (milliseconds + microseconds + nanoseconds) betterdate -ns
-tz <timezone> Display time in specified timezone betterdate -tz UTC
-US Use US date format (MM/DD/YYYY) betterdate -US
-NM Hide milliseconds (No Milliseconds) betterdate -NM
-NS Hide seconds (No Seconds) betterdate -NS
-sw <minutes> Start stopwatch countdown timer betterdate -sw 5
-h, --help Show help message betterdate -h
-v, --version Show version information betterdate -v

Date Format Options

Default (DD/MM/YYYY):

  • 15/01/2026 (15th of January, 2026)
  • International standard format

US Format (-US - MM/DD/YYYY):

  • 01/15/2026 (January 15th, 2026)
  • Common in United States

Time Display Options

Precision Levels:

  • Default: Milliseconds only (3 digits after seconds)

    • Format: HH:MM:SS.mmm
    • Updates every 1ms with sleep to save CPU
  • Microseconds (-ms): Milliseconds + Microseconds (6 digits total)

    • Format: HH:MM:SS.mmm.uuu
    • Updates as fast as possible (no sleep)
  • Nanoseconds (-ns): Milliseconds + Microseconds + Nanoseconds (9 digits total)

    • Format: HH:MM:SS.mmm.uuu.nnn
    • Updates as fast as possible (no sleep)

Visibility Options:

  • No Milliseconds (-NM): Hide all decimal precision

    • Format: HH:MM:SS
    • Shows seconds only
  • No Seconds (-NS): Hide seconds and milliseconds

    • Format: HH:MM
    • Shows hours and minutes only
    • Updates every minute, minimal CPU usage

Note: -NM and -NS take priority over -ms and -ns flags.

Stopwatch Feature

The stopwatch is a countdown timer that accepts time in minutes (supports decimals):

# Basic usage
betterdate -sw <minutes>

# Examples
betterdate -sw 5        # 5 minutes
betterdate -sw 1.5      # 1 minute 30 seconds
betterdate -sw 0.5      # 30 seconds
betterdate -sw 0.1      # 6 seconds
betterdate -sw 0.0167   # 1 second

Stopwatch behavior:

  • Displays countdown in MM:SS format
  • Updates every second
  • Beeps 5 times when timer finishes (using system bell)
  • Press Ctrl+C to stop early
  • Automatically exits after completion

Example output:

Stopwatch started for 5.000000 minutes. Press Ctrl+C to stop.
Time left: 04:59
Time left: 04:58
Time left: 04:57
...
Time left: 00:01
Time left: 00:00

Stopwatch finished!
[beep beep beep beep beep]

Common Timezones

Americas:

  • America/New_York - Eastern Time
  • America/Chicago - Central Time
  • America/Denver - Mountain Time
  • America/Los_Angeles - Pacific Time
  • America/Sao_Paulo - Brazil
  • America/Mexico_City - Mexico

Europe:

  • Europe/London - UK
  • Europe/Paris - France/CET
  • Europe/Berlin - Germany
  • Europe/Moscow - Russia

Asia:

  • Asia/Tokyo - Japan
  • Asia/Shanghai - China
  • Asia/Dubai - UAE
  • Asia/Kolkata - India
  • Asia/Singapore - Singapore

Pacific:

  • Australia/Sydney - Australia East
  • Pacific/Auckland - New Zealand

Other:

  • UTC - Universal Coordinated Time

Exiting the Program

Press Ctrl+C to exit. The program will gracefully restore your terminal cursor.


How It Works

Technical Details

Time Retrieval:

  • Uses clock_gettime() with CLOCK_REALTIME for high-precision time
  • Provides up to nanosecond resolution on supported platforms
  • Calculates milliseconds, microseconds, and nanoseconds from tv_nsec

Display Method:

  • Uses ANSI escape codes to control terminal cursor
  • \033[?25l - Hides cursor for cleaner display
  • \033[2A - Moves cursor up 2 lines (with epoch)
  • \033[1A - Moves cursor up 1 line (without epoch)
  • \033[?25h - Shows cursor again on exit
  • Overwrites same lines for smooth, flicker-free updates

Time Conversion:

  • Unix epoch: raw timestamp (seconds since January 1, 1970)
  • Date formatting:
    • Default: DD/MM/YYYY
    • US format: MM/DD/YYYY (swaps day and month)
  • Time precision breakdown:
    • Milliseconds: tv_nsec / 1000000 (0-999)
    • Microseconds: (tv_nsec / 1000) % 1000 (0-999)
    • Nanoseconds: tv_nsec % 1000 (0-999)
  • 12-hour conversion handles midnight (0 → 12 AM) and noon (12 → 12 PM)

Signal Handling:

  • Catches SIGINT (Ctrl+C) for graceful shutdown
  • handle_exit() function ensures cursor is restored before program exits
  • Prevents terminal from being left in a corrupted state

Timezone Support:

  • Uses setenv("TZ", timezone, 1) to set timezone
  • Calls tzset() to apply timezone change
  • Only affects the running program, not system settings
  • Defaults to system timezone if -tz not specified

Stopwatch Implementation:

  • Uses time() for second-level precision
  • Calculates elapsed time and remaining time
  • Simple countdown display with MM:SS format
  • Uses system("tput bel") for beep sound (5 times)
  • Hides cursor during countdown, restores on exit

Performance Optimization:

  • Default mode: sleeps 1ms between updates (~0.1% CPU)
  • High-precision modes (-ms, -ns): no sleep for maximum update rate (~5-10% CPU)
  • No seconds mode (-NS): updates every minute (~0% CPU)
  • Automatic adjustment based on precision requirements

Building from Source

Prerequisites

  • GCC or compatible C compiler
  • Make
  • Unix-like operating system (Linux, macOS, BSD, Windows with MinGW/Cygwin)
  • POSIX-compliant C library

Build Process

  1. Clone the repository:

    git clone https://github.com/ThatGuyCodes605/BetterDate.git
    cd BetterDate
  2. Compile:

    make
  3. Test locally (without installing):

    make run
    # or
    ./betterdate
  4. Install system-wide:

    sudo make install
  5. **Clean ...

Read more

v1.5

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 15 Jan 21:18
da9fce0

Read the WIKI or README to see what's changed

This program works on FreeBSD, OpenBSD, DragonFlyBSD, NetBSD, Linux, macOS, and Windows

betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.

Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux, where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: v1.4...v1.5

v1.4

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 15 Jan 16:41
f7ef67c

Read the WIKI or README to see what's changed

This program works on FreeBSD, OpenBSD, DragonFlyBSD, NetBSD, Linux, macOS, and Windows

betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.

Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux, where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: v1.3...v1.4

v1.3

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 15 Jan 15:38
de57e09

Read the WIKI or README to see what's changed

This program works on FreeBSD, OpenBSD, DragonFlyBSD, NetBSD, Linux, macOS, and Windows

betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.

Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux, where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: v1.2...v1.3

v1.2

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 15 Jan 13:50
6628f1a

14 Janbetterdate - Real-time Clock Display
⚠️ Supports FreeBSD OpenBSD NetBSD DragonflyBSD MacOS Windows and Linux
betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.
What it does:

Displays the Unix epoch (seconds since January 1, 1970)
Shows the current date and time with millisecond precision
Updates in place every millisecond without scrolling the terminal
Hides the cursor while running for a cleaner display

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.
Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: v1.1...v1.2

v1.1

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 14 Jan 21:58
85e4dc0

betterdate - Real-time Clock Display
⚠️ Linux only for now
betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.
What it does:

Displays the Unix epoch (seconds since January 1, 1970)
Shows the current date and time with millisecond precision
Updates in place every millisecond without scrolling the terminal
Hides the cursor while running for a cleaner display
Use -12 to get 12 hour time

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.
Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: v1.0...v1.1

v1.0

Choose a tag to compare

@ThatGuyCodes605 ThatGuyCodes605 released this 14 Jan 12:48
199cb2d

betterdate - Real-time Clock Display
⚠️ Linux only for now
betterdate is a real-time clock display that continuously updates to show both the current date/time and Unix epoch timestamp.
What it does:

Displays the Unix epoch (seconds since January 1, 1970)
Shows the current date and time with millisecond precision
Updates in place every millisecond without scrolling the terminal
Hides the cursor while running for a cleaner display

How it works:
The program uses ANSI escape codes to control the terminal cursor, moving it up two lines to redraw the time display in the same spot, creating a smooth updating effect.
Platform compatibility:
The program uses clock_gettime() with CLOCK_REALTIME and precise nanosleep timing, which are designed for Linux systems. While it may compile on other platforms, it's intended and tested for Linux where these POSIX real-time functions work as expected.
To exit the program, press Ctrl+C.

Full Changelog: https://github.com/ThatGuyCodes605/BetterDate/commits/v1.0