[TYPO3] Date Calculations (add 7 hours to value in, register:SYS_LASTCHANGED)

bmv bernard.munslow at iws.es
Wed Jul 9 12:38:31 CEST 2008


Hi Stefan,

Why not access the information from a php script and edit it from there?

The .php script could look like this:

<?php

class user_functions {


    function addTime($content,$conf){
   
        $time = $GLOBALS['TSFE']->page['SYS_LASTCHANGED'];
       
        $hour = date (G,$time);
        $day = date('d',$time);
        $month = date ('m', $time);
        $year = date ('Y', $time);
       
        echo date("d-m-Y", mktime($hour+7, 0, 0, $month, $day, $year));
   
            }
}

?>

This script adds 7 hours to the time that was stored in 
SYS_LASTCHANGED.  You could also specify the number of hours to be added 
by means of variable, which could be initialized in your template record 
and then sent to the php script.

Finnally, edit the template record in order to insert the content from 
the script:
 
page = PAGE
page.typeNum = 0

#Specify path of your custom php script
page.includeLibs.some_random_id_string = fileadmin/time_stamp.php


page.20 = USER
page.20.userFunc = user_functions->addTime


I hope this can be of help for you.


Best regards,


.- Bernard
> Date: Tue, 8 Jul 2008 19:07:53 +0200
> From: "Stefan Amstein" <info at webcream.ch>
> Subject: [TYPO3] Date Calculations (add 7 hours to value in
> 	register:SYS_LASTCHANGED)
> To: typo3-english at lists.netfielders.de
> Message-ID:
> 	<mailman.13884.1215536883.4573.typo3-english at lists.netfielders.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello Everybody,
>
> I want to display the date of the last update on a certain page, but the
> server is located in a different timezone. the following code shows the
> update date which is 7 hours in the past
>
> lib.update = TEXT
> lib.update.wrap = &nbsp;Letzte Aktualisierung:&nbsp;|&nbsp;
> lib.update.strftime = %d.%m.%Y
> lib.update.data = register:SYS_LASTCHANGED
>
> can anybody tell me how to add 7 hours to the date from
> register:SYS_LASTCHANGED
>
> Thanks a lot for your help
>
>
> Stefan
>
>   


More information about the TYPO3-english mailing list