Logo

Programming-Idioms

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

Idiom #184 Tomorrow

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

require 'active_suport'
t = 1.day.since.to_s
require "date"
t = Date.tomorrow.to_s

tomorrow is a Ruby on Rails method
require "date"
t = (Date.today + 1).to_s
var t = DateTime.Today.AddDays(1).ToShortDateString();

You can start with DateTime.Today or with DateTime.Now

Today will include the current date, whereas Now will also include the time of day.

if you add 1 day to now, you will get a time of day tomorrow.
e.g. 9:15 AM today plus 1 day = 9:15 AM tomorrow

New implementation...
< >
steenslag