How to contruct "0:00, yesterday"?

Author Message

Marco Zinn

Monday 03 November 2003 1:50:49 pm

For a news page, I want to display (and count) all articles, that are "new" on some frontpage.
How do I create a timestamp, which is "0:00 of yesterday", because I want to compare to that time in order to show all articles of today and yesterday?

Or, if the template operators cannot do that, how do I create "now - 24h" to check for news in the last 24 hours?

Marco
http://www.hyperroad-design.com

Paul d

Monday 12 December 2005 10:33:38 am

Hi,

I use this code for 24hs ago:

{def $today_ts = currentdate()}
{def $yesterday = sub($today_ts,86400)}

Regards,
Pd

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 31 2025 06:12:50
Script start
Timing: Jan 31 2025 06:12:50
Module start 'layout'
Timing: Jan 31 2025 06:12:50
Module start 'content'
Timing: Jan 31 2025 06:12:50
Module end 'content'
Timing: Jan 31 2025 06:12:50
Script end

Main resources:

Total runtime0.0287 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.1328151.2109
Module start 'layout' 0.00700.0027 739.343836.6484
Module start 'content' 0.00960.0175 775.992290.2813
Module end 'content' 0.02710.0015 866.273429.9922
Script end 0.0286  896.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00269.0714140.0002
Check MTime0.00113.7558140.0001
Mysql Total
Database connection0.00082.892410.0008
Mysqli_queries0.003311.548730.0011
Looping result0.00000.041610.0000
Template Total0.00113.710.0011
Template load0.00082.791710.0008
Template processing0.00030.914210.0003
Override
Cache load0.00051.856710.0005
General
dbfile0.004917.134680.0006
String conversion0.00000.034140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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