SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot dizyn's Avatar
    Join Date
    Apr 2006
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SET time_zone problem

    Hi,

    I am facing a problem in SET time_zone

    PHP Code:
    mysql_query("SET time_zone = '+4:00'") or die("");
    mysql_query("insert into `aa` set mytim = now()") or die(""); 
    I expect this to insert time GMT +4 time in database but it does not do that. how can i do that? i have field of "timestamp" type and i want to insert FMT +4 time in it when updated.

    any help please

    thanks

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    697
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Code:
    insert into aa(mytim)
      values(current_timestamp + interval '4' hour)


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
  •