[Typo3-dev] convert timestamp to TYPO3 datetime

Peter Russ peter.russ at 4dfx.de
Thu Sep 23 18:00:53 CEST 2004


Sacha Vorbeck wrote:

> Hi Peter,
> 
> if you enter 9:30 into a time field in the BE, it is converted to 34200 
> and 9:31 is converted to 34260.
> 
> The js-function that generates the 5digit timestamp should be in 
> http://yourdomain/typo3/t3lib/jsfunc.evalfield.js
> 
> Isn`t there a method that converts a common timestamp created with 
> mktime into the 5digit format used by TYPO3?
> 
> Handcoded I would transfer 9:30 to 9,5 and multiply it by 60 two times. 
> But this doesn`t look really elegant to me.
> 

Are you mixing something? In Mysql and other DBs there is a difference 
between  Time, Timestamp and Datetime.
Timestamp always starts on 01.01.1970, Time starts always at midnight 
and Datetime starts at 1000-01-01 00:00:00, i.e. January 1st 1000 of 
Gregorian calendar. In Mysql there is no guarantee that earlier values 
will work :-(

So this might be a Scandinavian special as Mysql and Kaspar are located 
in northern Europe ;-)

The point with Typo3 is, that if you assign a type to an advanced string 
input field the supported items are not that compatible as they should 
be to get the correct value into the DB. But you could fix the JS!

But perhaps TV might fix that too :-)

Regs. Peter.




More information about the TYPO3-dev mailing list