Results 1 to 2 of 2

Thread: timestamp and timezone

  1. #1
    User
    Join Date
    11-23-09.
    Location
    Valais, Switzerland
    Posts
    77

    Default timestamp and timezone

    Hello,

    I have some date and time stored in the db. Everything is saved as "varchar(10) NOT NULL default '0'," as timestamp. The normal Contao way of datetime.

    We know that in Contao backend you can set the timezone your using.

    Question 1 :
    Now, when I what to use a timestamp, should I correct-it with the timezone by myself? (normally yes)

    Question 2 :
    Is there a best practice (I mean the Léo way ;-) )

    Question 3 :
    Is this different if you are in frontend, backend or extends Backend, Module...

    Thanks

  2. #2
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: timestamp and timezone

    Every date or time can be parsed two ways: either via parseDate() function or by a Date class. I am not sure if they consider timezone, but you could check that really fast:
    /system/libraries/Date.php
    /system/libraries/System.php (line 391)
    I don't see there any reference to timezone though.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •