Forums / Setup & design / Show the date of tomorrow

Show the date of tomorrow

Author Message

Antonino Ioppolo

Wednesday 10 December 2003 1:52:51 am

Hi,
I need to show the date of tomorrow in my template.
Does anybody know how to do this?

laurent le cadet

Wednesday 10 December 2003 6:57:02 am

Hi,

If you need to display only the date, you can try this :

{currentdate()|l10n( datetime )}

(this is from the demo version).

laurent

Antonino Ioppolo

Monday 15 December 2003 8:58:27 am

Hi, sorry for the delay. I've been really busy.

Anyway, Laurent, you misunderstood my question.

Nevertheless, I found a solution for making it so I'm posting in case it's useful for other people

What I needed was to display the date of tomorrow, i.e. today is December 15, I need to write December 16.

Well it's kind of a dirty hack but it's the best I could find.

Firs of all edit eztemplateautoload.php, located in /kernel/common, and add the following function

function tomorrow()
{
$tomorrow = mktime (0,0,0,date("m") ,date("d")+1,date("Y"));
return ($tomorrow);
}

Then edit template.ini locate under /settings:
Locate the section
PHPOperatorList[]

and add the line

PHPOperatorList[tomorrow]=tomorrow

now you can call the function in your template using something like this

{tomorrow()|datetime(custom,"%l %j %F %Y")}

I hope this is useful for other people.
By the way, if you have a better way to do this thing, post it ;)

laurent le cadet

Monday 15 December 2003 9:42:41 am

Sorry !

today, tomorrow...only 24 hours ;-)

Sorry again

Laurent

Brendan Pike

Tuesday 08 March 2005 11:45:14 pm

Incase anyone else is referencing this thread looking for a way to produce a future timestamp then see this thread for a better way.

http://www.ez.no/community/forum/general/how_can_i_set_a_specific_date_to_get_timestamp_please_help

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

eZ debug

Timing: Jan 31 2025 04:18:42
Script start
Timing: Jan 31 2025 04:18:42
Module start 'content'
Timing: Jan 31 2025 04:18:42
Module end 'content'
Timing: Jan 31 2025 04:18:42
Script end

Main resources:

Total runtime0.1264 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9297180.8359
Module start 'content' 0.00610.0065 768.765697.8672
Module end 'content' 0.01250.1138 866.6328525.8984
Script end 0.1263  1,392.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.8455200.0002
Check MTime0.00151.1934200.0001
Mysql Total
Database connection0.00100.753310.0010
Mysqli_queries0.083666.18551410.0006
Looping result0.00110.83361390.0000
Template Total0.113489.810.1134
Template load0.00090.724010.0009
Template processing0.112589.022710.1125
Override
Cache load0.00070.543510.0007
Sytem overhead
Fetch class attribute can translate value0.00060.443910.0006
XML
Image XML parsing0.00030.235810.0003
General
dbfile0.00695.4652200.0003
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs