# 100 Day Countdown

It is common to start countdowns 100 days prior to an event, probably because of our base 10 system. Examples of this can be found everywhere:

• 100 days until your birthday
• 100 days until the wedding
• 100 days until the election
• 100 days until our graduation
• 100 days until her due date
• 100 days until football season
• 100 days until you get the Fanatic badge

You get the picture. It seems that the 100th day before an event is second place only to the actual event. So for this challenge, I need to know what the date will be in 100 days, so that I can determine what I should start counting down too.

No input

## Output

The date 100 days from the current date based on the standard Gregorian Calendar (Make sure to account for leap years). Output is flexible as long as the date format is human read-able (eg 2016-10-8, 10-8-16, [ 2016, 10, 8 ], 10/8/16 12:00:00 AM).

## Winning

Code golf: shortest code in bytes

### Examples

100 days from today (Apr 5th, 2017) is Friday, July 14 2017.

Current                Future
-------                ------
01/01/2001 +100        04/11/2001
01/01/2004 +100        04/10/2004
01/01/1900 +100        04/11/1900
01/01/2000 +100        04/10/2000

07/04/2017 +100        10/12/2017
10/31/2017 +100        02/08/2018
12/25/2017 +100        04/04/2018

08/29/1941 +100        12/07/1941
06/03/2001 +100        09/11/2001

• Can I add the current time to the output? Commented Apr 6, 2017 at 4:05
• @Titus no, just the future date Commented Apr 6, 2017 at 10:30
• Most answers include a date and time now, I think this should be allowed.
– G B
Commented Apr 6, 2017 at 12:25
• "Because of our bas 10 system"? No, if we counted in binary, we'd likely count down from 100 - except that would take only four days, rather than a hundred... Commented Apr 6, 2017 at 12:54
• @12431234123412341234123 this format is perfectly readable for me (in fact, it's pretty much a de-facto standard where I live). It all depends on where you're from. Commented Apr 8, 2017 at 20:30

# SAS, 52 bytes

%put%sysfunc(intnx(day,%sysfunc(date()),100),date9.)


## VBA, 8 bytes

?now+100


output:

2017-07-16 10:13:19


Works in the Immediate Window. Beats Excel by 2 bytes by skipping parentheses.

## R, 1614 21 bytes

print(Sys.Date()+100)

"2017-07-16"

• you forgot a little zero Commented Apr 7, 2017 at 9:13
• What I mean is that you need a print command. You cannot assume a REPL environment. If you run your code here and it's not printed to Output, then your code isn't a valid solution. Commented Apr 7, 2017 at 16:03
• @mbomb007 I'd like to see some kind of citation that R must work in TIO. I've never seen an R answer link to TIO. I also just ran this code in a Unix terminal and the output was the same. Can I assume the code is allowed to be run in a terminal?
– BLT
Commented Apr 7, 2017 at 16:56
• codegolf.meta.stackexchange.com/q/2419/8478: Default Program or Function codegolf.meta.stackexchange.com/q/7842/8478: but also REPL Commented Apr 7, 2017 at 17:24
• We treat REPLs as a separate language. So if your code requires a REPL to execute, you should list it as "R REPL" or something similar. In the same way, "Hello, World!" is not a valid "Hello World" program in Python, since it requires print in front to actually print to STDOUT in a non-repl environment. Commented Apr 7, 2017 at 17:25

# Perl 6, 20 bytes

print Date.today+100


Try it online!

## Pyke, 6 bytes

wVs2h


Try it online! (doesn't use literal because I can't figure out how to embed it)

w      -  get 100 in 2 bytes
Vs2h - Repeat ^ times
s2  -   increment the day part
h -  strip the time part


Hexdump:

77 84 56 73 32 68


# AWK, 43 bytes

BEGIN{print strftime("%F",systime()+864e4)}


Could save a few bytes if run using some input... maybe... using something like:

{$0=strftime("%F",systime()+864e4)}1  and running the code like: awk '{$0=strftime("%F",systime()+864e4)}1'<<<1


But then we have to account for the bytes used to do that. So I'll stick with simplicity :)

# VBScript, 18 bytes

dateadd(d,100,now)


## JavaScript, 21 bytes

Date(+new Date+864e7)


Actually, you don't really need new before Date.

Based on this post.

document.body.innerHTML = Date(+new Date+864e7);

• Uhm, somehow the embracing Date function always returns the current date. Is this code correct? Also, you probably meant to write 864e4 if that is supposed to be the number of seconds in 100 days. Maybe the unit is milliseconds, I don’t know. Commented Mar 14 at 15:31

# k6 and q, 8 bytes

.z.d+100


Apparently, .z.d returns the current date, and the default units when adding to dates are days.

# Wolfram Language, 19 bytes

DatePlus[Today,100]


Kinda self-explanatory but let's explain.

DatePlus (From Wolfram Language Reference)

DatePlus[date,{n,"unit"}] gives the date n units after date.

Possible offset units are "Year", "Quarter", "Month", "Week", "Day", "Hour", "Minute", "Second", "Weekday", "Weekend", Monday through Sunday, "EndOfMonth", and "BusinessDay".

Offsets can also be specified using the Quantity framework.

{y,m,d} is taken to be equivalent to {y,m,d,0,0,0} etc.

DatePlus[date,offset] gives results in the same general format as date.

When date is a list, the result has the same length as date, possibly extended to include the smallest unit in offset. »

When date is a string, the result is in the form specified by \$DateStringFormat.

Today (From Wolfram Language Reference)

Today
gives a DateObject representing the current day.

So basically, it just adds 100 days to the current date. See screenshot below.

# Matlab/Octave, 16 bytes

datestr(now+100)


Pretty much self-explanatory and (a bit) boring, but could not be missing!

# Japt, 9 bytes

Ð864e7+Kj


Test it

A port of the existing JS answer.

# NodeJS, 96 bytes

require('http').createServer(function(q,s){s.end(':'+new Date(Date.now()+(864e7)))}).listen(8e3)


My first codegolf attempt ever, but I can't find anything to make it shorter.

• Welcome to PPCG! Just because NodeJS is a server framework, you don't have to make a server to display the output. Something as simple as console.log would suffice for outputting the result :) Commented Apr 7, 2017 at 1:02
• @ConorO'Brien true, but I thought it may worth an entry to show, how NodeJS can utilize the same result with it's intended purpose. However, you may argue, whether http server is the sole purpose of the framework, so I admit it may have been unnecessary. Commented Apr 7, 2017 at 1:36
• Even so, you can shorten it with an arrow function. Commented Apr 8, 2017 at 8:15

## HP‑41C series, 16 Bytes

This program requires an HP‑41CX or an HP‑41C/CV with a time module plugged in. After energizing the clock’s electronics, the clock is set to January 1, 1900, 0:00 a. m, so set the clock first.

01♦LBL⸆T           5 Bytes  global label requires 4 + (length of string) Bytes
02 DATE            2 Bytes  obtain current date in MM.DDYYYY or DD.MMYYYY format
NULL            1 Byte   invisible Null byte before numbers
03 100             3 Bytes  push 100 on to the stack (Y ≔ date; X ≔ 100)
04 DATE+           2 Bytes  add 100 days (X) to today’s date (Y) and yield date
05 FIX 6           2 Bytes  ensure _all_ digits of the date are visible
06 RTN             1 Byte   RTN does not affect local label search


The X register (the top of the stack) now contains the date in MM.DDYYYY format (or DD.MMYYYY should you have changed that by invoking the DMY command).

Limitations: The result of the DATE+ and other time‑related calculation operations can be “any date from October 15, 1582 (the beginning of the Gregorian calendar) through September 10, 4320” (quoted from the HP‑41CX Owner’s Manual Vol. 2).

# Swift 5.9, 53 bytes

import Foundation
print("\(Date()+864e4)".prefix(10))