Forums / Developer / attribute of type Date

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

attribute of type Date

Author Message

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...

anne martinet

Friday 27 June 2008 2:07:41 am

oki ;)

thanks a lot!