Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to the POSIX.1-2001 standard, next month (as in incrementing <code>tm_mon</code> before calling <code>mktime</code>) is done by adjusting the values until they fit. So, for example, next month from January 31, 2001 is March 3, 2001. This is because the <code>tm_mday</code> of 31 isn't valid with <code>tm_mon</code> of 1 (February), so it is normalized to <code>tm_mon</code> of 2 (March) and <code>tm_mday</code> of 3.</p> <p>The next month from January 31, 2000 is March 2, 2000, because Feb. has 29 days that year. The next month from January, 1 2038 doesn't exist, depending.</p> <p><a href="http://xkcd.com/927/" rel="nofollow">The great thing about standards is there are so many to chose from</a>. Check the SQL standard, I bet you can find a different meaning of next month. I suspect ISO 8601 may give you yet another choice. Point is, there are many different behaviors, the meaning of 'next month' is very domain-specific.</p> <p>edit: I <em>think</em> I've found how SQL-92 handles it, apparently asking for next month from January 31 is an error.</p> <p>Links:</p> <ul> <li>SQL-92: <a href="http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt" rel="nofollow">http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt</a></li> <li>POSIX: <a href="http://pubs.opengroup.org/onlinepubs/9699919799/" rel="nofollow">http://pubs.opengroup.org/onlinepubs/9699919799/</a> (though apparently that version now defers to ISO C, which doesn't seem as clear. The mktime manpage on my machine is clear, though)</li> <li>ISO C: <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf</a></li> <li>Java: <a href="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html" rel="nofollow">http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload