Post by Brook » Sat Dec 04, 2010 5:56 am

Currently I think that I understand that you can get the time of the web server in php by calling the Now() function.

Because my web server is in a different time zone than I am in, I would like to subract 6 hours from the current web server time. Example when I login to the Admin I would like to see the time shown on my Admin website in my timezone time.

Example If the current webserver time is 12:00am, I would like to display on my PHP page that it is 6:00pm, since my time zone is 6 hours behind my web server time. Example, I have the User Login Module installed, which shows the users who are currently online and shows a column for Last Activity (showing the web server time of the user's last activity).

What code would I use to subract 6 hours from the current web server time n PHP?
Last edited by Brook on Sat Dec 04, 2010 8:41 am, edited 1 time in total.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by JAY6390 » Sat Dec 04, 2010 7:27 am

$unix_timestamp = strtotime('-6 hours');

That will give you the time in a unix timestamp format that you can use with the date function to create your timestamp

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom
Who is online

Users browsing this forum: Bing [Bot] and 87 guests