Ricordisamoa added a comment.

In https://phabricator.wikimedia.org/T85296#1125595, @Jc3s5h wrote:

> I find it alarming that 31 September was corrected to 1 October.


That's how JavaScript and PHP work:

  > new Date( 2015, 8, 30 ).toDateString()
  'Wed Sep 30 2015'
  > new Date( 2015, 8, 31 ).toDateString()
  'Thu Oct 01 2015'



  php > echo var_export( date( 'D M d Y', strtotime( '2015-09-30' ) ) ) . "\n";
  'Wed Sep 30 2015'
  php > echo var_export( date( 'D M d Y', strtotime( '2015-09-31' ) ) ) . "\n";
  'Thu Oct 01 2015'

Python throws an exception instead:

  >>> from datetime import datetime
  >>> datetime(2015, 9, 30).strftime('%a %b %d %Y')
  'Wed Sep 30 2015'
  >>> datetime(2015, 9, 31).strftime('%a %b %d %Y')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ValueError: day is out of range for month


TASK DETAIL
  https://phabricator.wikimedia.org/T85296

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Ricordisamoa
Cc: Jc3s5h, Liuxinyu970226, Ricordisamoa, Addshore, thiemowmde, JanZerebecki, 
Aklapper, daniel, Smalyshev, Wikidata-bugs, aude



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to