[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1771815971901.jpg (60.2 KB, 1280x1280, img_1771815963084_br7a5wkj.jpg)ImgOps Exif Google Yandex

aeae4 No.1278

sometimes im working with a web extension that needs hardcoded dates for testing future scenarios. but updating it isnt always easy since we cant deploy changes right away ⚠️ Changing these tests manually is tricky, so knowing how quickly tweak the system clock on my local machine comes in handy

heres what you do: open terminal and type this command:
sudo date -s "YYYY-MM-DD HH:mm:ss"


replace YYYY with year (2035), MM for month(1-12) DD day of the mo. 4 digits, H is hour in a military time format.

for example:
$ sudo date -s '2026-08-17 9:45'

this sets my mac's clock to august 17th at nine forty-five am ⏰

anyone else run into issues with hardcoded dates in their projects? or do you have any other neat tricks for testing future scenarios without changing your code directly

full read: https://davidwalsh.name/mac-set-date


[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">