ZF-8650: Fractions of second problem

Issue Type: Bug Created: 2009-12-28T12:21:44.000+0000 Last Updated: 2010-01-14T07:41:14.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Christian Welzel (gawain) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


I use Zend_Date to work with Timestamps of DB2. These timestamps are in text form and look like this: YYYY-MM-dd HH:mm:ss.S Parsing this format works well, but outputting it has an bug with the fractions part: leading Zeros are left out. This timestamp '2009-12-29 03:51:21.016145' gets outputted as '2009-12-29 03:51:21.16145', although the fraction presition is set to 6. I use $date->toString('YYYY-MM-dd HH:mm:ss.S') for generating the output.


Posted by Thomas Weidner (thomas) on 2010-01-14T07:41:12.000+0000

Fixed with r20279.

Note that your example is also errorous. When you define milliseconds, then the number 12345 will be converted into 12 seconds and 345 milliseconds. You need to change the precision before working with other factors.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.