Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:50:50+00:00 2026-05-28T06:50:50+00:00

Imagine it’s Jan 19. This will not be hard if you look at this

  • 0

Imagine it’s Jan 19. This will not be hard if you look at this question today.

Date.today
 => Thu, 19 Jan 2012    # as expected

Date.today + 1
 => Fri, 20 Jan 2012    # as expected

Date.today+1
 => Fri, 20 Jan 2012    # as expected

Date.today +1
 => Thu, 19 Jan 2012    # ?!

What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:50:51+00:00Added an answer on May 28, 2026 at 6:50 am

    The difference is that:

    Date.today + 1 
    

    is an addition of two numerical values and

    Date.today +1 
    

    is a call to the method today with the parameter sg(day of calendar reform) with value +1

    The best way to examine this is to monkey patch the original method with debug output included. See this script as example:

    require 'date'
    
    class Date
    
      def self.today(sg=ITALY)
         puts "ITALY default("+sg.to_s+")" if sg==ITALY
         puts sg unless sg==ITALY
         jd = civil_to_jd(*(Time.now.to_a[3..5].reverse << sg))
         new0(jd_to_ajd(jd, 0, 0), 0, sg)
      end
    
    end
    
    puts "- Addition:"
    Date.today + 1
    puts "- Parameter:"
    Date.today +1
    

    This will print the following console output:

    - Addition:
    ITALY default(2299161)
    - Parameter:
    1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
Imagine this db structure: `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `correct` tinyint(1) NOT NULL
imagine this html on a page <div id=hpl_content_wrap> <p class=foobar>this is one word and
Imagine a very big gwt project of application. This is just a some form
Imagine I have this structure: class Foo { String bar } Now imagine I
Imagine I have a column of a table like this: b - 1 1
Imagine if you will a layout that contains a circle within an elipse. The
Imagine this: Class A{ private int a; } Class B{ public void fn(){ A
Imagine you're writing a library. Say, this library is going to be used in
Imagine this, Step 1: ASPX Page Loads. Step 2: Button fires a script that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.