Skip Menu |

This queue is for tickets about the DateTime-Format-W3CDTF CPAN distribution.

Report information
The Basics
Id: 3771
Status: resolved
Priority: 0/
Queue: DateTime-Format-W3CDTF

People
Owner: Nobody in particular
Requestors: aaron [...] aaronland.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.04



Subject: format_datetime() 'round midnight
If you pass the format_datetime method a DateTime object whose timestamp is set explicitly as "00:00:00", the method will not print a timestamp or an offset. The code appears to be doing a simple boolean test on h/m/s, each if which (rightly) return '0'. I'm not sure if this is a bug but it is ambiguous and should at least be documented.
I'm not sure if it is a but either. DateTime.pm doesn't allow any way to distinguish between a date without an explicit time component, and a date that has been explicitly set to midnight. It might be a better solution to always print out the full timestamp. What do you think? [guest - Thu Sep 11 09:26:16 2003]: Show quoted text
> If you pass the format_datetime method a DateTime object whose > timestamp is set explicitly as "00:00:00", the method will not print a > timestamp or an offset. > > The code appears to be doing a simple boolean test on h/m/s, each if > which (rightly) return '0'. > > I'm not sure if this is a bug but it is ambiguous and should at least > be documented.
Been too long since I thought about this. The correct solution is: * format_datetime() should always return the full timestamp * format_date() should be used be used when you don't want the time component * the code should stop trying to be too smart