php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52519 microseconds in DateInterval are missing
Submitted: 2010-08-02 23:06 UTC Modified: 2016-10-05 20:59 UTC
Votes:15
Avg. Score:4.3 ± 0.8
Reproduced:15 of 15 (100.0%)
Same Version:3 (20.0%)
Same OS:1 (6.7%)
From: giorgio dot liscio at email dot it Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3.3 OS: xp x64 all
Private report: No CVE-ID: None
 [2010-08-02 23:06 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, the property $seconds should be float or a $microseconds property is missing in the class DateInterval

http://www.php.net/manual/en/class.dateinterval.php

thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 00:38 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: derick
 [2010-08-07 02:51 UTC] giorgio dot liscio at email dot it
hi thank you for accepting this bug

since ISO8601 does not specify how to treat microseconds

i think the best way to implement this is with seconds treated as floats

"P10.342192S"

see http://bugs.php.net/bug.php?id=52519 too

again, thank you for this library and for your attention on my requests

:)
 [2010-08-07 02:52 UTC] giorgio dot liscio at email dot it
sorry, bad link http://bugs.php.net/bug.php?id=52514
 [2010-08-30 17:52 UTC] derick@php.net
ISO 8601 actually allows fractions for seconds (see section 5.3.1.3)
 [2011-01-22 08:51 UTC] stas@php.net
-Type: Bug +Type: Feature/Change Request
 [2016-10-05 20:04 UTC] derick@php.net
For var_dump(), the microseconds are now there - and also used when doing diff() or add().
 [2016-10-05 20:59 UTC] derick@php.net
-Status: Assigned +Status: Closed
 [2016-10-05 20:59 UTC] derick@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

As ISO 8601 does not support fractions for seconds for intervals, this will not be implemented.

The original property for DateInterval's microseconds ("f") has been added for PHP 7.1.0RC4.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC