On 19 Sep 2014, at 16:31, Esteban A. Maringolo <[email protected]> wrote:

> 2014-09-19 11:14 GMT-03:00 Sven Van Caekenberghe <[email protected]>:
>> 
>> On 19 Sep 2014, at 14:59, Esteban A. Maringolo <[email protected]> wrote:
>> 
>>> 2014-09-19 9:16 GMT-03:00 Sven Van Caekenberghe <[email protected]>:
>>> Pharo Date/DateAndTime are incremental[1], then all this
>>> week/month/year operations will simply add/subtract the increment from
>>> epoch.
>>> 
>>> The only way to do this in a deterministic way is to have a field based 
>>> Date.
> 
>> Saying that it is not deterministic is a bit harsh ;-)
> 
> Sorry, it wasn't my intention. Maybe "consistent" was the proper word. :)
> 
>>> [1] http://www.w3.org/TR/2005/NOTE-timezone-20051013/#d2e310
> 
>> Very interesting link, really useful - Thx.
> 
> At least it makes you understand some pros/cons about date implementations.
> After reading that I understood why Java's Calendar object is field based.
> 
> 
> Additionally
> I would like this:
> '2014/08/31 24:00' asDateAndTime -> "2014/09/01 00:00"
> 
> Or even better:
> '2014/08/31 24:00' asDateAndTime -> "2014/08/31 24:00"
> And:
> '2014/08/31 24:00' asDateAndTime = '2014/09/01 00:00' asDateAndTime

Actually, 

ZTimestamp fromString: '2014/08/31 24:00:00'. 

 => '2014-09-01T00:00:00Z'

(ZTimestampFormat fromString: '2001/02/03 16:05') parse: '2014/08/31 24:00'. 

 => '2014-09-01T00:00:00Z'

but that is not really by design, it just does normalisation.

I am not sure what to think of that, it is certainly interesting ;-)



Reply via email to