Hi Stef,

> On 22 Oct 2017, at 17:45, Stephane Ducasse <[email protected]> wrote:
> 
> Hi sven
> 
> I'm confused
> 
> ft := ZTimestampFormat fromString: '02/11/2017'.
> ft format: DateAndTime now
> 
> produces  10/11/1017060986
> 
> While I do not want time but just the date.
> and the date is wrong.
> 
> So I will do it manually but I found sad that ZTimestampFormat cannot
> handle just handling days.
> I could then pass also a date and it would not ask for nanoseconds.
> 
> Stef

ZTimestampFormat works with example based format specifications. This works by 
making each component unique, using a sequential number. Consult the class 
comment for a full explanation. The class side's #formatSpecifications lists 
the tokens that are understood and their meaning.

To go back to your issue, The year is the first component, written as 2001, the 
month the third and the day the second. So you probably want to do:

(ZTimestampFormat fromString: '03/02/2001') format: DateAndTime now. 

  => '22/10/2017'

HTH,

Sven



Reply via email to