Forums / Developer / attribute of type Date
anne martinet
Thursday 26 June 2008 5:44:16 am
Hi!
In one of my classes, I use the type Date for my attribute date. But when I instanciate this attribute like this:
Day :01 Month : 09 Year : 1952
My draft couldn't be stored!
And with these values:
Day : 01 Month : 09 Year : 2000
I didn't have any problemes!Why?
Thanks.
Laurent BOURREL
Thursday 26 June 2008 6:49:08 am
Hi,
This is a normal feature of the date attribute. the storage is based on a unix timestamp. As you can see in http://ez.no/doc/ez_publish/technical_manual/4_0/reference/datatypes/date : "The valid input range is 01.01.1970 - 19.01.2038."
So it's a problem for a birthday date for example...
If you really need a Date to store your attribute (ie you need some date formats or transformations in your templates), you should have a look to the birthday datatype :http://ez.no/developer/contribs/datatypes/birthday_datatype. i don't know if it's ok for the last eZ versions...
Friday 27 June 2008 2:07:41 am
oki ;)
thanks a lot!