Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #184 Tomorrow

Assign to variable t a string representing the day, month and year of the day after the current date.

DateTime t = DateTime.Today.AddDays(1);
var now = new DateTime.now();
var t = now.add(new Duration(days: 1));
import "time"
t := time.Now().Add(24 * time.Hour).Format("2006-01-02")
import java.time.LocalDate
LocalDate t = LocalDate.now() + 1
var currentDate = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
var t = `${day}/${month}/${year}`;
var now = new Date()
var year = now.getFullYear()
var month = now.getMonth()
var day = now.getDate()

var tomorrow = new Date(0)
tomorrow.setFullYear(year, month, day + 1)
tomorrow.setHours(0, 0, 0, 0)

var shortDateFormat = Intl.DateTimeFormat(undefined, { dateStyle: "short" })
var t = shortDateFormat.format(tomorrow)
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
import java.time.LocalDate;
LocalDate t = LocalDate.now().plusDays(1);
(ql:quickload :chronicity)
(setf _t (chronicity:parse "tomorrow"))
$t = new \DateTime('tomorrow');
$t = date('D',strtotime('+1 day'));
SysUtils;
t := DateToStr(Now+1.0);
use DateTime qw();
my $dt = DateTime->today;
$dt->add(days => 1);
my $t = $dt->strftime('%F');
from datetime import date, timedelta
date.today() + timedelta(days=1)
require 'active_suport'
t = 1.day.since.to_s
require "date"
t = Date.tomorrow.to_s
require "date"
t = (Date.today + 1).to_s
let t = chrono::Utc::now().date().succ().to_string();
Dim t As Date = Date.Today.AddDays(1)

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

steenslag