Here the user added material from Ukraine, and the server date and time was entered in the database. For example, 2012-10-10 15:25

And I, the user from Russia, should see the time of addition - Moscow, the Chinese user - the Chinese. Russia for example 16:25, China 20:45

What features are needed for this? Or what do you need for such an implementation?

    2 answers 2

    Here , here:

    alt text

    and javaScript.

    • @istem, how can a date be converted so that each country sees its own? I do not understand this. JS for what here? :) - ModaL
    • 2
      Elementary. Option 1: The client's IP is determined, the region is determined by IP, the hourly offset relative to the server is determined by region. The offset is sent to the client, the date of the new Date () is adjusted on the client, taking into account the offset received. Option 2: Server time is sent to the client. On the client, you immediately get a new Date () - determine the time zone relative to the server. Set the cookie with the current offset. On the server, when generating pages, use this offset. - istem
    • @istem, and you can not do without js? Everything to do on the server. For example, in undstaym server time will be recorded. Further if to put set diapazone London, then the added Unix will display Lond values? - ModaL
    • See for yourself how you prefer. I just advised. - istem

    Just need to set the necessary time zone for each user .. I really don’t remember, only in PHP or in MySQL too.

    • @Photon, first you need to get the country, and then) - ModaL
    • I agree .. But what a question, such is the answer .. - Photon