SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    865
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Using timezone to display right time

    I want to be able to give a time-stamp that is correct based on where one of my users lives. When establishing my database, I created a column called timezone until I can figure out how to do this. Is this a question better suited for the PHP forum?

    Any suggestions?

    Thanks.

  2. #2
    ********* Addict
    Join Date
    Apr 2000
    Location
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have a timezone field, you say? Well it's pretty easy then... Say, the current timestamp would simply be
    PHP Code:
    $current time() + 3600*$time_offset
    That is, of course, considering your server is set to your reference time zone... To format it you would just use the normal php functions, such as date ()...

    Pedro.


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
  •