100 Day Countdown

25

1

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.

Input

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

NonlinearFruit

Posted 2017-04-06T02:20:19.993

Reputation: 5 334

2Can I add the current time to the output? – Titus – 2017-04-06T04:05:33.650

1@Titus no, just the future date – NonlinearFruit – 2017-04-06T10:30:52.747

1Most answers include a date and time now, I think this should be allowed. – G B – 2017-04-06T12:25:17.350

1@GB When you output the future date, the format is flexible (could include timestamp) as long as it is human readable. However, current time/date is not acceptable. – NonlinearFruit – 2017-04-06T12:27:09.403

5"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... – Toby Speight – 2017-04-06T12:54:51.437

110/8/16 is not human readable, it can be 2010-08-16, 2016-08-10 or 2016-10-08. Please avoid this date format – 12431234123412341234123 – 2017-04-07T10:53:08.283

1@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. – Cássio Renan – 2017-04-08T20:30:38.733

@CássioRenan It can not be, because it can be read in 3 different ways. it is not possible to be readable without more informations. (or from where do you know which of this 3 possible formats are used) – 12431234123412341234123 – 2017-04-09T04:56:31.653

1@12431234123412341234123 that's not a good point. In fact, 2010-08-16, 2016-08-10 and 2016-10-08 are also ambiguous. In my case they're much worse: Since there's no date format where I live that starts with a year, I have no way of knowing whether these formats are day/month or month/day. Something being human-readable implies language/convention. In the case of a flexible question such as this one, this means you have to specify the format, along with the date, much like you would do with other types of data. Forbidding a format just because you cannot read it is just rude. – Cássio Renan – 2017-04-10T16:49:30.183

@CássioRenan The problem is not that i can not read this format, the problem is there are 3 different used formats which all lock the same. And no one use YYYY-DD-MM (it is also the only format which make sense, since it is complete Bigendian and not mixed). To the language language convention, there are english speaking countrys which are DD/MM/YY used mostly and other english speaking where MM/DD/YY used mostly, so there is no convention which you can count on (so this format is not distinct and therefor can not be readable). – 12431234123412341234123 – 2017-04-11T10:39:24.160

Answers

42

Excel, 10

=NOW()+100

Demonstration

enter image description here

Digital Trauma

Posted 2017-04-06T02:20:19.993

Reputation: 64 644

Wow it can be that easy? xD – WasteD – 2017-04-06T08:02:45.217

1Also works in Google Sheets. – Okx – 2017-04-06T11:00:17.967

11Excel is always good for code golf that involves parsing dates. – Engineer Toast – 2017-04-06T12:21:22.847

2Is there a language pack for excel in which the NOW function is spelled out with just two letters? In that case, you could save 1 byte. – iFreilicht – 2017-04-07T09:20:47.283

13Yep, Dutch has 'nu()' – Tominator – 2017-04-07T09:31:35.487

Do =100+now( also work? it works in LO-calc – 12431234123412341234123 – 2017-04-07T11:11:01.107

@12431234123412341234123 the closing bracket is required, at least on Excel 2016. – colsw – 2017-04-07T15:57:46.587

2

Although, per date part only, you'd have to use =TODAY()+100 or =TEXT(NOW()+100,"MM/dd/yyyy")

– KyleMit – 2017-04-07T19:36:49.483

As i already wrote, this format is not readable, not for humans nor for machines. – 12431234123412341234123 – 2017-04-09T04:58:56.370

20

Bash, 17 16 15 14 13 bytes

date -d100day

It turns out the date command takes some pretty flexible input for relative timings. You can also do things like 1 year, 1 week ago, yesterday, etc. It's pretty cool.

-1 byte by realizing that bash does not care about grammar.
-1 byte because the space between 100 and day is unnecessary.
-1 byte because I don't need quotes anymore because I don't have a space in the string.
-1 byte by removing the space after -d (thanks ASCII-only!)

HyperNeutrino

Posted 2017-04-06T02:20:19.993

Reputation: 26 575

New favorite command +1 – NonlinearFruit – 2017-04-06T02:32:52.357

@NonlinearFruit Hah, yeah, it's probably one of my favorite commands. Thanks! – HyperNeutrino – 2017-04-06T02:37:34.500

You don't need the space after -d – ASCII-only – 2017-04-06T02:47:10.323

@ASCII-only Oh, okay. Thanks! – HyperNeutrino – 2017-04-06T02:47:41.950

10

PowerShell, 10 bytes

(date)+1e2

Thanks to ConnorLSW for the +1e2 trick.

It appears that doubles (1e2 is a double) are also added as days.

Previous version, 12 bytes:

(date)+"100"

Apparently you can add strings to dates in PowerShell. The string "100" is converted into a 100 days-TimeSpan.

Danko Durbić

Posted 2017-04-06T02:20:19.993

Reputation: 10 241

2Ok don't ask me why, but even though (date)+100 doesn't work, (date)+1e2 does... I guess 1e2 is actually a double whereas 100 is a number until it's compiled, i.e. you can't call 100.GetType() but you can 1e2.GetType() - that's -2 and brings us to a draw with Excel! – colsw – 2017-04-06T16:18:04.130

@ConnorLSW If it help or adds to the confusion 100 is seen as adding 100 ticks where as the string "100" is taken as days. Both are valid PS but only one does what we need. – Matt – 2017-04-06T18:32:16.363

@Matt 1e6 is still a number and is added as days though? – colsw – 2017-04-06T18:33:14.313

That is interesting then. Perhaps there is more going on under the hood where that number reaches over a threshold.... I do not know – Matt – 2017-04-06T18:35:07.557

I think it's somehow related to the old DATE type which is an 8-byte floating point number with days being represented as whole number increments. I guess that's what Excel is using.

– Danko Durbić – 2017-04-06T19:15:04.833

seems like (date)+[double]100 also adds as days, so I think @DankoDurbić is totally right, (date)+[int]100 doesn't, oh Microsoft. – colsw – 2017-04-07T15:52:35.133

7

Mediawiki, 19bytes

{{#time:r|+100day}}

You may try it with wikipedia's sandbox

tsh

Posted 2017-04-06T02:20:19.993

Reputation: 13 072

Welcome to PPCG! – Martin Ender – 2017-04-08T11:05:50.530

6

PHP, 28 bytes

<?=date(Y_m_d,time()+864e4);

human readable version, 35 bytes:

<?=date(Y_m_d,strtotime("100day"));

almost readable, 34 bytes:

<?=date(Y_m_d,strtotime(1e2.day));

-4 bytes if also printing the time is accepted: replace Y_m_d with r or c.

It´s National Holiday in France in 100 days.

Titus

Posted 2017-04-06T02:20:19.993

Reputation: 13 814

The underscores made me do "Why underscores, is it a constant? No, a string OH WAIT 'SPACES'!!" Clever. – Martijn – 2017-04-07T07:58:47.100

@Martijn Turn on E_NOTICE and You´ll know: Y_m_d is an undefined constant and PHP assumes a string. This works with any valid word (including all function names) apart from keywords, predefined constants and case insensitive true, false and null.

– Titus – 2017-04-07T10:42:40.467

5

Ruby, 16 bytes

p Time.now+864e4

Try it online!

G B

Posted 2017-04-06T02:20:19.993

Reputation: 11 099

Was going to answer this, nice. But I get different results for 864e4 and 8640000 and I don't quite know why. I blame TIO. EDIT: when you use p, the two values produce a different result. But when you use puts, they're the same. – snail_ – 2017-04-10T13:09:10.330

I don't understand, I get the same result with both. Can you post an example? Maybe it depends on the locale? – G B – 2017-04-10T13:41:57.120

p Time.now+864e4 is around 4 days behind p Time.now+8640000 on TIO. I tried it multiple times. However, if you use puts, this distinction doesn't exist. I don't really know if my locale matters, US East should be pretty normal :P I guess I'll try running it on my own PC when I get home. – snail_ – 2017-04-10T15:15:05.590

5

Javascript, 29 26 25 bytes

Saved 3 bytes thanks to @ASCII-only!

Saved 1 byte thanks to @JohanKarlsson

new Date(+new Date+864e7)

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

Thomas W

Posted 2017-04-06T02:20:19.993

Reputation: 746

1You can use 864e7 instead of 864*10e6 – ASCII-only – 2017-04-06T10:18:56.313

1You can save 1 byte by using +new Date instead of Date.now() – Johan Karlsson – 2017-04-06T12:00:58.300

1This is a snippet. You need to include console.log – mbomb007 – 2017-04-07T16:10:49.470

5

SQL (PostgreSQL), 19 Bytes

SELECT now()+'100d'

Richard

Posted 2017-04-06T02:20:19.993

Reputation: 331

4

Vim, 27 bytes

:r!date "+\%F" -d"+100 day"

try it online!

enter image description here

Edit: Removed unnecessary space char.

ersinakyuz

Posted 2017-04-06T02:20:19.993

Reputation: 89

2If you're using Linux date, the one on this page is date -d100day, not sure if it will help though – ASCII-only – 2017-04-06T10:26:47.700

I test it with :r!date +\%F -d100day this also works (at least on my pc (C)), but is the same as HyperNeutrino already use in bash. – 12431234123412341234123 – 2017-04-07T11:03:37.020

Uh, you can save bytes by just eliminating vim and doing it in bash. – David Conrad – 2017-04-08T08:05:14.200

4

MATL, 9 bytes

Z'100+1XO

Output format is 15-Jul-2017 (which I find most readable). Change 1XO to 2XO to get the format used in the examples, 07/15/17.

Try it online!

Explanation

Z'      % Push current date and time as a serial date number
100+    % Add 100
1XO     % Convert to string with format 'dd-mmm-yyyy'. Implicitly display

Luis Mendo

Posted 2017-04-06T02:20:19.993

Reputation: 87 464

4

SQL (Microsoft), 35 31 bytes

SELECT DATEADD(D,100,GETDATE())

Tombas

Posted 2017-04-06T02:20:19.993

Reputation: 51

You can use d instead of DAY and remove the spaces inside DATEADD. – mbomb007 – 2017-04-06T16:27:43.047

Even I didn't know you could use d. I use dd or day in practice. I just tried it and it worked. – mbomb007 – 2017-04-07T03:12:28.637

3

Mathematica, 26 21 bytes

-5 bytes thanks to @KiranLinsuain!

Today+Quantity@"100d"

If including the time is permitted, then we can save 2 bytes:

Now+Quantity@"100d"

numbermaniac

Posted 2017-04-06T02:20:19.993

Reputation: 639

1"Now + Quantity["100d"]" cuts it down quite a bit, but may not always work on all versions. – k-l – 2017-04-07T05:41:33.223

3

C#, 103 97 bytes

Thanks to raznagul for saving 6 bytes!

using System;class P{static void Main(){Console.Write(DateTime.Now.AddDays(100).ToString("d"));}}

Full program which reads the current date, adds 100 days and displays the result in M/d/YYYY format.

You can change the date format by adding a few more bytes:

using System;class P{static void Main(){Console.Write(DateTime.Now.AddDays(100).ToString("d-M-yyyy"));}}

To eliminate boilerplate code - C# isn't exactly known to be very compact - an anonymous function can be used:

C# lambda, 49 43 bytes

()=>DateTime.Now.AddDays(100).ToString("d")

Full program:

using System;

class P
{
    static void Main()
    {
        Func<string> f = 
        ()=>DateTime.Now.AddDays(100).ToString("d");

        Console.WriteLine(f());
    }
}

adrianmp

Posted 2017-04-06T02:20:19.993

Reputation: 1 592

For the full program I think you can write System.DateTime.Now... to avoid "using System;" – Taemyr – 2017-04-06T07:33:08.487

1@Taemyr: That would be longer, as he also needs it for Console.Write. – raznagul – 2017-04-06T08:17:16.243

2@adrianmp: You can save save 6 bytes by using .ToString("d") instead of .ToShortDateString(). – raznagul – 2017-04-06T08:24:59.650

3

Java 8, 77, 61 bytes

()->System.out.print(java.time.LocalDate.now().plusDays(100))

Try it online!

Keerthana Prabhakaran

Posted 2017-04-06T02:20:19.993

Reputation: 759

Is there a reason you don't include the boilerplate? (ie 'class A{public static. . .') For Java, I believe at is necessary for a full program. You could do a lambda ()->java.time.LocalDate.now().plusDays(100). – NonlinearFruit – 2017-04-06T10:34:45.950

I had that before editing my answer. It was 94 bytes along with the boilerplate. I new to golfing with java. hence I aint sure about whether I had to include that! – Keerthana Prabhakaran – 2017-04-06T10:46:22.163

2Submissions (unless otherwise specified) can be either a full program (runnable by some interpreter without modification) or a function. – NonlinearFruit – 2017-04-06T12:22:47.690

3

Noodel, 8 bytes

]5@LaƇ⁺ƈ

Try it:)


How it works

]5@LaƇ⁺ƈ
]5@La    # The string "]5@La" gets pushed onto the stack which in base 98 represents 8,640,000,000.
     Ƈ   # Pushes an integer that represents the current time where highest resolution is milliseconds.
      ⁺  # Add the time and the string which will be interpreted as 8,640,000,000ms.
       ƈ # Convert the integer to human readable time.
         # Implicitly output to the screen.

<div id="noodel" code="]5@LaƇ⁺ƈ" input="" cols="80" rows="2"/>

<script src="https://tkellehe.github.io/noodel/noodel-latest.js"></script>
<script src="https://tkellehe.github.io/noodel/ppcg.min.js"></script>

tkellehe

Posted 2017-04-06T02:20:19.993

Reputation: 605

The character Ƈ is the unicode character U+0187, which is too large to be displayed in a single byte. Same goes for ƈ (U+0188). So while this is 8 characters long, the minimum byte-length is 10. – iFreilicht – 2017-04-07T09:33:35.143

1@iFreilicht, Noodel uses its own encoding. The editor does everything in UTF-16 to work better visually, but gets encoded based off of the Noodel code page before parsing. – tkellehe – 2017-04-07T10:24:25.430

3

C, 87 46 44 bytes

saved 2 bytes thanks to Albert Renshaw

f(){time_t t=time(0)+864e4;puts(ctime(&t));}

I realized the output is flexible enough to allow for day of week and time, so there's no need to use localtime or the tm structure at all.

Old answer

f(){time_t t=time(0)+8640000;char b[9];strftime(b,9,"%d-%m-%y",localtime(&t));puts(b);}

Based on Khaled.K's answer, but instead of messing with the tm structure, adds the number of seconds equivalent to 100 days directly to the time_t value. It also prints only the date, without time or day of week.

As it should happen on a golfed program, some ugly warnings are generated on compilation.

Try it online!

Ungolfed:

f(){
    // Current time + 100 days
    time_t t=time(0)+8640000;
    // Buffer for printing formatted time
    char b[9];
    // Print the time in format dd-mm-yy to buffer
    strftime(b,9,"%d-%m-%y",localtime(&t));
    // print buffer
    puts(b);
}

Cássio Renan

Posted 2017-04-06T02:20:19.993

Reputation: 211

2Shave 2 bytes by replacing 8640000 with 864e4 – Albert Renshaw – 2017-04-07T07:43:10.310

2

JavaScript, 42 bytes

(d=new Date()).setDate(d.getDate()+100)&&d

setInterval(_=>document.body.innerHTML=(d=new Date()).setDate(d.getDate()+100)&&d,1000)

ASCII-only

Posted 2017-04-06T02:20:19.993

Reputation: 4 687

I used your answer as inspiration to mine http://codegolf.stackexchange.com/questions/115436/100-day-countdown/115496#115496 ;)

– Thomas W – 2017-04-06T10:16:07.987

2

IBM/Lotus Notes Formula, 29 bytes

@Adjust(@Today;0;0;100;0;0;0)

Unfortunately @Adjust requires the trailing 0's for the missing hh:mm:ss.

If we were allowed to display the time as well then changing @Today to @Now would save 2 bytes for 27.

ElPedro

Posted 2017-04-06T02:20:19.993

Reputation: 5 301

2

JavaScript (ES6), 44 bytes

_=>new Date(Date.now()+864e7).toDateString()

25 bytes if returning a date with the time is acceptable:

_=>Date(Date.now()+864e7)

Neil

Posted 2017-04-06T02:20:19.993

Reputation: 95 035

2

30 bytes

Mysql!

select NOW()+INTERVAL 100 DAY;

SQLite

SELECT date('now','+100 day');

Keerthana Prabhakaran

Posted 2017-04-06T02:20:19.993

Reputation: 759

2

C, 120 113 bytes

#include <time.h>
f(){time_t t=time(0);struct tm*tm=localtime(&t);tm->tm_mday+=100;t=mktime(tm);printf("%s",ctime(&t));}

Live Demo

#include <stdio.h>
#include <time.h>

void PrintDatePlus100days()
{
    // obtain current time
    time_t t = time( 0 );

    // convert to datetime struct
    struct tm *tm = localtime( &t );

    // add 100 days
    tm->tm_mday += 100;

    // convert to time_t
    t = mktime( tm );

    // print time in readable format
    puts( ctime( &t ) );
}

Khaled.K

Posted 2017-04-06T02:20:19.993

Reputation: 1 435

If I'm not mistaken, you don't need to account for #include ... boilerplate when submitting functions. (Java answers, for example, don't need import in that case) – Cássio Renan – 2017-04-06T23:43:55.677

@CássioRenan in Java you don't need to count the default imports like java.lang.*, just like how we don't count stdio.h and stdlib.h in C. But even in java, you need to either consider custom imports or put the path in the class name like java.util.Date, and that counts in your score. – Khaled.K – 2017-04-07T09:03:19.120

2Why using printf() would puts() not also work? – 12431234123412341234123 – 2017-04-07T11:04:40.433

2

F# (53 bytes)

printf"%s"(DateTime.Now.AddDays(100.0).ToString("d"))

Rik

Posted 2017-04-06T02:20:19.993

Reputation: 781

Don't see a lot of F# answers on here. Kudos! – David Conrad – 2017-04-08T08:16:40.783

2

Swift 3, 39 bytes

print(Date(timeIntervalSinceNow:864E4))

Matt

Posted 2017-04-06T02:20:19.993

Reputation: 289

I'd argue you don't need the import foundation;. Swift runs just on iOS and that is auto imported there. – Albert Renshaw – 2017-04-07T07:37:31.977

There aren't too many Swift answers here yet, so not sure what the consensus is. But I think you have a good point, I'll remove the import :) – Matt – 2017-04-07T10:11:46.547

@Albert Swift also runs on Mac OS and Linux. I don't know what that means for whether the import is required, though. – David Conrad – 2017-04-08T08:10:36.830

2

R (REPL), 14 bytes

Sys.Date()+100

Try it on Ideone.

armipunk

Posted 2017-04-06T02:20:19.993

Reputation: 139

1This is a snippet. Your code is required to output the result, either as the result of a function, or to STDOUT as a full program. – mbomb007 – 2017-04-06T20:25:59.833

Let us continue this discussion in chat.

– mbomb007 – 2017-04-07T16:04:31.920

@mbomb007 REPL answers are allowed, but they're considered a separate language.

– Dennis – 2017-04-11T22:35:50.513

@Dennis It wasn't listed as REPL before. – mbomb007 – 2017-04-12T03:48:58.407

2

PowerShell, 23

(get-date).adddays(100)

This is my first ever try, so please give me constructive feedback. Thanks!

Mahi Taher

Posted 2017-04-06T02:20:19.993

Reputation: 21

1

Python, 63 bytes

from datetime import*
print(datetime.now()+timedelta(days=100))

Very simple solution really. Because the datetime.now() result is the same type as the result of timedelta, it happily adds the two together.

user67196

Posted 2017-04-06T02:20:19.993

Reputation:

It doesn't have to be a function. You could remove the lambda: and it would still be a full program. – NonlinearFruit – 2017-04-06T03:15:53.597

@NonlinearFruit Yes but print would have to be added and that makes it the same number of bytes. – None – 2017-04-06T03:20:25.153

If you use Python 2, you can remove brackets in print to save 1 byte – Dead Possum – 2017-04-06T09:26:58.817

the days= is optional, that would save 5+1 bytes (python2 print's brackets) – Felipe Nardi Batista – 2017-04-06T11:10:03.300

Golfed down to 57 bytes: from datetime import*;print datetime.now()+timedelta(100) – Mr. Xcoder – 2017-04-06T13:16:09.273

And he's deleted...:P – CalculatorFeline – 2017-04-07T02:31:59.047

Do you need the datetime in datetime.now(), if you have already imported * from it? – Comrade SparklePony – 2017-04-07T16:50:53.427

@SparklePony yes, the datetime module includes a datetime class. Docs

– Ash – 2017-04-08T22:12:59.640

Down to 55 bytes by using date.today rather than datetime.now: from datetime import*;print date.today()+timedelta(100) – Ash – 2017-04-08T22:14:02.490

1

JavaScript, 38 Bytes

d=new Date;d.setDate(d.getDate()+100);d

A little bit shorter than ASCII-only answer.

document.write(eval("d=new Date;d.setDate(d.getDate()+100);d"))

Nurrl

Posted 2017-04-06T02:20:19.993

Reputation: 11

1

Golang, 58 bytes

import ."time"
func f(){Println(Now().AddDate(0, 0, 100))}

Full Program

package main

import . "time"
import . "fmt"

func main() {
    Println(Now().AddDate(0, 0, 100))
}

try it online!

ersinakyuz

Posted 2017-04-06T02:20:19.993

Reputation: 89

1

Oracle, 34 bytes

SELECT CURRENT_DATE+100 FROM DUAL;

AMB

Posted 2017-04-06T02:20:19.993

Reputation: 111

1

Python 2 + Pandas 0.19.1, 56 51 bytes

from pandas import*
print Timestamp('now','D')+100

miradulo

Posted 2017-04-06T02:20:19.993

Reputation: 111

1

SAS, 52 bytes

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

J_Lard

Posted 2017-04-06T02:20:19.993

Reputation: 351

1

R, 16 14 21 bytes

print(Sys.Date()+100)

"2017-07-16"

BLT

Posted 2017-04-06T02:20:19.993

Reputation: 931

you forgot a little zero – Dan Chaltiel – 2017-04-07T09:13:23.253

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.

– mbomb007 – 2017-04-07T16:03:25.627

1@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 – 2017-04-07T16:56:23.623

https://codegolf.meta.stackexchange.com/q/2419/8478: Default Program or Function https://codegolf.meta.stackexchange.com/q/7842/8478: but also REPL – mbomb007 – 2017-04-07T17:24:24.770

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.

– mbomb007 – 2017-04-07T17:25:08.567

@mbomb007 Thanks, and sorry you had to wrangle two of us on this. Now edited. – BLT – 2017-04-07T18:21:59.127

1

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.

Maciej Lipinski

Posted 2017-04-06T02:20:19.993

Reputation: 47

1

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);

Piotr Wegner

Posted 2017-04-06T02:20:19.993

Reputation: 11

1

Perl 6, 20 bytes

print Date.today+100

Try it online!

David Conrad

Posted 2017-04-06T02:20:19.993

Reputation: 1 037

1

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

Blue

Posted 2017-04-06T02:20:19.993

Reputation: 26 661

1

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 :)

Robert Benson

Posted 2017-04-06T02:20:19.993

Reputation: 1 339

1

VBScript, 18 bytes

dateadd(d,100,now)

Shaggy

Posted 2017-04-06T02:20:19.993

Reputation: 24 623

1

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.

Running the command above in q and k6.

zgrep

Posted 2017-04-06T02:20:19.993

Reputation: 1 291

1

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.


enter image description here

Jimwel Anobong

Posted 2017-04-06T02:20:19.993

Reputation: 159

1

Matlab/Octave, 16 bytes

datestr(now+100)

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

DimP

Posted 2017-04-06T02:20:19.993

Reputation: 251

0

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.

Zoltán Schmidt

Posted 2017-04-06T02:20:19.993

Reputation: 191

3Welcome 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 :) – Conor O'Brien – 2017-04-07T01:02:30.813

@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. – Zoltán Schmidt – 2017-04-07T01:36:27.860

1Even so, you can shorten it with an arrow function. – David Conrad – 2017-04-08T08:15:40.617