Hacker News new | past | comments | ask | show | jobs | submit login

Basically just use the output of `date -u`.



It's locale-specific, which is not great.



Use `date -u -Iseconds`, please ;-)


    date: illegal option -- I
    usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
                [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]



Let me guess, you are on a Mac.


Probably on an older Mac or FreeBSD. On my macOS 12.6, `man date` says:

    The -I flag was added in FreeBSD 12.0.


Yup. macOS Catalina




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: