The end of time

date -ud @$[2**31-1]
The end of unix time and the 32bit era will be Tue Jan 19 03:14:07 UTC 2038 . date -ud @$[2**31] date: invalid date `@2147483648' . In 64bit you have much longer, at least to: date -ud @$[2**55] Sun Jun 13 06:26:08 UTC 1141709097
Sample Output
Tue Jan 19 03:14:07 UTC 2038

-148
By: Escher
2009-09-11 08:48:50

These Might Interest You


  • 1
    utime(){ python -c "import time; print(time.strftime('%a %b %d %H:%M:%S %Y', time.localtime($1)))"; }
    4Aiur · 2010-05-14 08:00:44 0
  • Adds the time in 12hr AM/PM format to the beginning of a prompt. Change \@ to \t for 24-hour time or \T for 12hr without AM/PM. To keep the time the next time you open a terminal, edit ~/.bashrc and stick the command at the bottom. Show Sample Output


    1
    export PS1="(\@) $PS1"
    cmdq · 2010-11-22 04:50:21 0
  • the --time-style argument to 'ls' takes several possible modifiers: full-iso, long-iso, iso, locale, +FORMAT. The +FORMAT modifier uses the same syntax as date +FORMAT. --time-style=+"%Y-%m-%d %H:%M:%S" strikes a happy medium between accuracy and verbosity: ls -lart --time-style=long-iso doesn't show time down to the nearest second, ls -lart --time-style=full-iso displays time to 10E-9 second resolution, but with no significant digits past the full seconds, also showing the timezone: -rw-r--r-- 1 bchittenden bchittenden 0 2011-02-10 12:07:55.000000000 -0500 bar Show Sample Output


    4
    ls -l --time-style=+"%Y-%m-%d %H:%M:%S"
    bartonski · 2011-02-10 17:15:37 2
  • I've had a horrible time trying to pipe the output of some shell built-ins like 'time' to other programs. The built-in doesn't output to stdout or stderr most of the time but using the above will let you pipe the output to something else. Show Sample Output


    1
    TIME=$( { time YOUR_COMMAND_HERE; } 2>&1 ) ; echo $TIME
    allrightname · 2010-11-18 15:48:05 0

What Others Think

At -151 without even a single comment? What the fsck? Clearly this shows a flaw in the commandlinefu rating system!
unixmonkey365 · 350 weeks and 3 days ago
Probably rolled over. 32bit, dontchaknow.
DewiMorgan · 328 weeks and 5 days ago
I know this isn't really a useful command, but I'm surprised something would get downvoted so much that isn't malicious or anything.
flarn2006 · 143 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: