how to calculate a future date

Author Message

Jacks JNK

Monday 12 January 2009 11:39:37 pm

how to calculate a future date at a fixed date?
Example: we are on 23 January 2009 and I want to automatically calculate the date after 2 weeks. What to do?

Skype : jacks_ngala

Kristof Coomans

Tuesday 13 January 2009 2:44:37 am

You can use eZDate::adjustDate().

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jacks JNK

Tuesday 13 January 2009 4:27:57 am

Can you be clear please ?

Skype : jacks_ngala

Kristof Coomans

Tuesday 13 January 2009 5:22:15 am

I assumed you wanted to know how to do this in PHP code, since you also weren't clear in which language you wanted to accomplish this :)

In template code, you'll have to use the date/time related template operators, gettime() and maketime() or makedate(). They are documented here http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators/miscellaneous. Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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 15:59:27
Script start
Timing: Jan 18 2025 15:59:27
Module start 'layout'
Timing: Jan 18 2025 15:59:27
Module start 'content'
Timing: Jan 18 2025 15:59:28
Module end 'content'
Timing: Jan 18 2025 15:59:28
Script end

Main resources:

Total runtime0.6847 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0313152.6250
Module start 'layout' 0.00640.0032 741.656339.4453
Module start 'content' 0.00970.6738 781.1016550.1172
Module end 'content' 0.68340.0012 1,331.218812.1641
Script end 0.6847  1,343.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4883160.0002
Check MTime0.00140.2011160.0001
Mysql Total
Database connection0.00100.146010.0010
Mysqli_queries0.630892.1345600.0105
Looping result0.00050.0667580.0000
Template Total0.658196.120.3291
Template load0.00220.320420.0011
Template processing0.655995.794720.3280
Template load and register function0.00010.015010.0001
states
state_id_array0.00080.111110.0008
state_identifier_array0.00080.118420.0004
Override
Cache load0.00180.2619160.0001
Sytem overhead
Fetch class attribute can translate value0.00090.124320.0004
Fetch class attribute name0.00140.206560.0002
XML
Image XML parsing0.00090.137820.0005
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00080.1125220.0000
String conversion0.00000.001240.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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.0002 secs