how to add 1 day to current date

Author Message

meriam santos

Thursday 05 November 2009 5:13:16 pm

i have this question on date on how to get tomorrows daycurrentdate() - will give you date todayhow about date tomorrow.currently working on agenda template and need to display the events tomorrow.hope somebody guides me on how to do this.BTW thanks heaps to Andre for the Agenda template.thanks...

meriam santos

Thursday 05 November 2009 7:09:13 pm

additional. this will be needed to display tomorrows event in the agenda template.

H-Works Agency

Friday 06 November 2009 3:38:07 am

You can easily do it with php's built-in function :

$new_date = date('d/m/y', strtotime('10/01/09' . " + 1 day"));

EZP is Great

Radek Kuchta

Friday 06 November 2009 7:15:20 am

I think that Meriam wants to get this date in a templat.

If yes, you can use currentdate operator:

<span class="line">{def $now = currentdate()}
{def $tommorow = $now|sum( 86400 )}
</span>

http://ez.no/certification/verify/272582

Luc Chase

Friday 06 November 2009 9:30:05 pm

{currentdate()|sum(mul(60,60,24,1))|l10n( 'shortdate' )}

Change final value in mul() according to number of days forwards or backwards you want to go. Part days allowed e.g. 1.5 days

The Web Application Service Provider

Kristof Coomans

Saturday 07 November 2009 6:25:06 am

Instead of doing arithmetics on a timestamp, you can also use a combination of the currentdate(), datetime(), and the makedate() template operators:

{def $currentDate=currentdate()
     $currentMonth=$currentDate|datetime('custom', '%n')
     $tomorrowDay=$currentDate|datetime('custom', '%j')|sum(1)
     $tomorrowDate=makedate($currentMonth, $tomorrowDay)}

<strong>{$tomorrowDate|l10n('shortdate')}</strong>

{undef $currentDate $currentMonth $tomorrowDay $tomorrowDate}

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

meriam santos

Sunday 08 November 2009 2:01:37 pm

Thanks all for the Reply. i was going to use this to display tomorrows event in the agenda template.My next question is that - anybody there successful in displaying tomorrows event in the Agenda template instead of the Whole months event. i just need the Todays event (this is succesful)and Tomorrows Event(problematic one)of the calendar. got stuck on this the dont know how to move on.would really apreciate any reply.thanks....

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 11:04:35
Script start
Timing: Jan 18 2025 11:04:35
Module start 'layout'
Timing: Jan 18 2025 11:04:35
Module start 'content'
Timing: Jan 18 2025 11:04:36
Module end 'content'
Timing: Jan 18 2025 11:04:36
Script end

Main resources:

Total runtime1.0727 sec
Peak memory usage4,096.0000 KB
Database Queries75

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.9219152.6250
Module start 'layout' 0.00780.0041 740.546939.4453
Module start 'content' 0.01191.0592 779.9922690.6953
Module end 'content' 1.07110.0016 1,470.687516.1563
Script end 1.0727  1,486.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3473160.0002
Check MTime0.00160.1451160.0001
Mysql Total
Database connection0.00220.203410.0022
Mysqli_queries1.007693.9293750.0134
Looping result0.00090.0881730.0000
Template Total1.033996.420.5170
Template load0.00220.203220.0011
Template processing1.031796.180220.5159
Template load and register function0.00030.026010.0003
states
state_id_array0.00230.212710.0023
state_identifier_array0.00200.189220.0010
Override
Cache load0.00180.1674240.0001
Sytem overhead
Fetch class attribute can translate value0.00080.076150.0002
Fetch class attribute name0.00100.0934100.0001
XML
Image XML parsing0.00240.227750.0005
class_abstraction
Instantiating content class attribute0.00000.0013100.0000
General
dbfile0.00340.3187290.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs