Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different handling of default minutes/seconds in DateTime:createFromFormat() in PHP and HHVM #1331

Closed
kristapsk opened this issue Dec 10, 2013 · 4 comments

Comments

@kristapsk
Copy link
Contributor

Test script:

<?php
date_default_timezone_set('Europe/Riga');

echo 'Current time: ' . date('Y-m-d H:i:s') . "\n";

$format = 'Y-m-d';
$date = DateTime::createFromFormat($format, '2009-02-15');
echo "Format: $format; " . $date->format('Y-m-d H:i:s') . "\n";

PHP output:

Current time: 2013-12-10 14:44:53
Format: Y-m-d; 2009-02-15 14:44:53

HHVM output:

Current time: 2013-12-10 14:44:49
Format: Y-m-d; 2009-02-15 03:00:00
@scannell
Copy link
Contributor

Thanks for reporting this @kristapsk. Feel free to submit a PR if you (or anyone else reading this) gets to this before we do -- since the time itself is correct this is not high on the priority list.

@jeffchan
Copy link
Contributor

jeffchan commented Feb 7, 2014

working on this

@jeffchan
Copy link
Contributor

jeffchan commented Feb 8, 2014

(should have been fixed now by someone else). Can close once it's pushed out

@kristapsk
Copy link
Contributor Author

Just checked, it's fixed in master (but not 2.4.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants