The date is now Tuesday, March 178th, 2020.

perl -e 'use Date::Parse; use POSIX; my @t = localtime; print strftime ("%a Mar ", @t) . int (1 + 0.5 + ((str2time (strftime ("%Y-%m-%d 3:00", @t)) - str2time ("2020-03-01 3:00")) /(60*60*24))) . strftime (" %X %Z 2020\n", @t);'

Tue Mar 178 10:26:39 PDT 2020

Update: Might as well also have a realtime-updating JavaScript version...

Previously, previously, previously, previously, previously, previously, previously, previously, previously, previously.

Tags: , , , ,

16 Responses:

  1. Like a sucker, I was computing this by hand from the output of cal -y. First XEmacs and now this. I guess I owe you two drinks, should we ever meet.

  2. margaret says:

    i ran cpan after all these years... i hate me right now. i was trying to live a perl-free lifestyle but just when i think i'm out, they drag me back in!

    $ date "+%a Mar $(printf %d $(echo "3+($(date +%s)-$(date -v3m -v1d -v2020y -v15H -v0M -v0S "+%s"))/24/60/60" | bc)) %X %Z %Y"
    Tue Mar 179 11:43:15 PDT 2020

  3. tobi says:

    seems like this is just the right moment to say thanks regarding the caller() patch in youtubedown, so ... Thanks!

  4. Dude says:

    That explains the out-of-season red skies dropping all this "snow" over everything.

  5. Karellen says:

    Awesome. I now have cdate to go alongside sdate.

    Speaking of, it's Sep 9856th, 1993. Only 144 days to go 'til the 10,000th. If it were still the beforetimes, that might be cause for some kind of party.

    I wonder how long it will take until, when I notice an interesting date or event approaching, I stop reflexively thinking "I should get together with some friends to celebrate that." Hopefully by March 500th or so - I don't think I'll be able to handle the "...but now I can't" realisations for much longer than that.

    • k3ninho says:

      I've put a note in my calendar for something extra depressing on uh, 2020-03-322 (or 2021-01-17 in the beforecalendar).


    • mbourgon says:

      That is the deepest of deep cuts - I had to go check the wiki page since I didn't remember it. Thanks for the reminder!

  6. In R:

    $ Rscript -e 'march_date <- as.integer(Sys.Date() - as.Date("2020-02-29")); sub("XX", march_date, format(Sys.time(), "%Y-03-XX %T"))'

    [1] "2020-03-178 18:50:47"

  7. k3ninho says:

    Not sure why this isn't shell-tastic: $((`date +%j` - 60)). Using search suggests perl has $yday (in range 0-364 or 0-365).
    ...with warnings that it embodies the arcane knowledge that there was a 29th of February and 31 days of January beforetimes.


  8. tb says:

    I think the last %Y should be replaced with 2020. If march 2020 is forever, the year shouldn't change.

  9. Aristotle says:

    For myself a few minutes ago, or anyone who can’t be bothered to fire up CPAN to get Date::Parse…

    perl -e 'use POSIX; my $t = time; printf strftime("%a Mar %%d %X %Z 2020n", localtime $t), int(.5 + $t/(60*60*24) - 18321)'

  • Previously