[TYPO3-project-formidable] rdt_date: different behaviour when submitted

Uwe Schmelzer us at planungsgruppeinternet.de
Fri Oct 23 09:36:20 CEST 2009


Hi Pablo,

>> B) [...] (current value - 7200)

I've got that, too, some days ago.
Typo3 v4.2.9, Formidable 2.0.367.

>> As far as I know, TYPO3 stores timestamps in BD in GMT format, so in case B), is renderlet:DATE managing correctly timezones?

I could not fix the error, so my clues might be useless, but I'll post 
them anyway:

In EXT:ameos_formidable/api/base/rdt_date/api/class.tx_rdtdate.php
around Line 29
$this->getValue() is called
somewhere along the way, gmstrftime() is called.
This substracts 2 hours = 7200 seconds to GMT

gmstrftime() uses the servers locale (LC_TIME) to determine the 
timezone, not the timezone set in typo3-Configuration.

This might give a clue for further searches.

The current date handling of renderlet:DATE
might be correct, if LC_TIME is set correctly.
Maybe it is, on Jeromes Server, so he could not
recreate the behaviour?

 From the php manual:

Behaves the same as strftime() except that the time returned is 
Greenwich Mean Time (GMT).
For example, when run in Eastern Standard Time (GMT -0500),
the first line below prints "Dec 31 1998 20:00:00",
while the second prints "Jan 01 1999 01:00:00".

<?php
setlocale(LC_TIME, 'en_US');
echo strftime("%b %d %Y %H:%M:%S", mktime(20, 0, 0, 12, 31, 98)) . "\n";
echo gmstrftime("%b %d %Y %H:%M:%S", mktime(20, 0, 0, 12, 31, 98)) . "\n";
?>


HTH uwe

-- 
Herzliche Grüsse aus Sindelfingen

Uwe Schmelzer
us at planungsgruppeinternet.de

Planungsgruppe Internet
Parkstrasse 20
71063 Sindelfingen
Tel. 07031 / 704 089
Fax: 01805 / 233 633-00745

Pablo Santamaria Lois schrieb:
> Hi to all!
> 
> I would like to share with you a problem which arose to me while working with renderlet:DATE.
> 
> Using a formidable template in edition mode, I've seen the following behaviour:
> A) if I change renderlet's value using the widget, and then submit the form, value stored in DB seems to be the chosen one. (OK)
> B) however, if I submit the form without change renderlet's value, date in DB WILL be changed, to a different timestamp. (current value - 7200)
> 
> Let's see an example:
> A) I've selected 14/10/2009 in renderlet's widget, so in DB will be stored:
> 1255478400. This timestamp means [1]:
> - GMT: Wed, 14 Oct 2009 00:00:00 GMT
> - My timezone: Wed 14 Oct 2009 02:00:00 AM CEST
> 
> B) With previous timestamp in DB, I didn't change renderlet's value, but submitted the form. In DB will be stored the following: 1255471200, which means:
> - GMT: Tue, 13 Oct 2009 22:00:00 GMT
> - My timezone: Wed 14 Oct 2009 12:00:00 AM CEST
> 
> As far as I know, TYPO3 stores timestamps in BD in GMT format, so in case B), is renderlet:DATE managing correctly timezones?
> 
> In case B), Why date in BD is modified although it wasn't changed using the renderlet?
> 
> Any help from you will he highly appreciated.
> Thanks in advance, Pablo.
> 
> ----
> I'm using TYPO3 4.2.8 and Formidable 2.0.367
> $GLOBALS['TYPO3_CONF_VARS']['SYS']['serverTimeZone'] = 1
> 
> [1] http://www.epochconverter.com/
> 
> 
>       






More information about the TYPO3-project-formidable mailing list