How are 'sessdate' and 'duration' formatted?

How are 'sessdate' and 'duration' formatted?

by Mike Sportel -
Number of replies: 2

I'd like to import sessions directly into the database (phpmyadmin). But how are the sessdate-field and duration-field formatted? I know it's a 'bigint', but when I add a sesion the normal (and only) way, say with sessiondate 9.11.09 8:45, it is stored as 1257752700.

Please help.

Mike.

Average of ratings: -
In reply to Mike Sportel

Re: How are 'sessdate' and 'duration' formatted?

by Frederic Nevers -
Hi Mike,

the dates and times are stored in EPOCH format. Basically, the number 1257752700 represents the number of seconds from 1st January 1970 at 7AM.

PHP 'translates' those big numbers from the database into human readable format, you can find more info about those PHP functions here http://www.php.net/manual/en/function.strftime.php and here http://www.php.net/manual/en/ref.datetime.php. You can use this website http://www.epochconverter.com/ to get EPOCH timestamps from human readable date/time and vice versa.

Hope this helps

Cheers,
Fred
In reply to Frederic Nevers

Re: How are 'sessdate' and 'duration' formatted?

by Mike Sportel -

Hi Fred,

Wow, quick reply, thanks. I understand now. I'll try to import sessions and see how it goes. Maybe later I can make an import form in php and share it here.

Thanks,

Mike.