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!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:10:17
Script start
Timing: Jan 18 2025 16:10:17
Module start 'layout'
Timing: Jan 18 2025 16:10:17
Module start 'content'
Timing: Jan 18 2025 16:10:18
Module end 'content'
Timing: Jan 18 2025 16:10:18
Script end

Main resources:

Total runtime0.9425 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.9063152.6250
Module start 'layout' 0.00580.0035 740.531339.4297
Module start 'content' 0.00930.9319 779.9609470.3828
Module end 'content' 0.94120.0013 1,250.34388.1875
Script end 0.9425  1,258.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3255160.0002
Check MTime0.00130.1410160.0001
Mysql Total
Database connection0.00100.104110.0010
Mysqli_queries0.902395.7340570.0158
Looping result0.00040.0462550.0000
Template Total0.913296.920.4566
Template load0.00180.194920.0009
Template processing0.911396.688020.4557
Template load and register function0.00010.014710.0001
states
state_id_array0.00070.077310.0007
state_identifier_array0.00120.130120.0006
Override
Cache load0.00150.1630210.0001
Sytem overhead
Fetch class attribute can translate value0.00080.086320.0004
Fetch class attribute name0.00080.089330.0003
XML
Image XML parsing0.00050.052520.0002
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00060.0660100.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs