Question: I am using php, and mysql. When i insert a time value into mysql database on my local host, the correct time is applied. i am using the `now()` function for the time.

When i insert the time values into my\_sql database on my web-hosting account, it shows the wrong time zone. 

if a user from a different time zone posts something, and i am viewing it in my time zone, how can i set it so the time displayed to the user is relative to where the user is viewing it from.

```
$sql1="INSERT INTO notifications (stamp) 
            VALUES (now());

```

Answer: 
From [the documentation for `NOW()`](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_now):

> 
> The value is expressed in the current time zone.
> 
> 
> 

So if your local machine is in a different time zone to your host's machine, you *will* see different results.

You might want to consider using [`UTC_TIMESTAMP()`](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_utc-timestamp) instead. (It's not clear to me whether this will return a `DATETIME` value if used in the appropriate context, but that's probably what you want.)
Your webservers php.ini probably has a different timezone set.

You can change it in your php file via [`date_default_timezone_set()`](http://de.php.net/manual/en/function.date-default-timezone-set.php)