|
|
|
|
![]() ![]() |
Mar 25 2008, 07:27 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 60 Joined: 7-March 08 From: Swindon, England Member No.: 59,016 |
Hi my timezone is GMT and the code im using to display the time and date is this:
CODE date('l j F - g:i a') which would then display "Tuesday 25 March - 12:11 am" But the time for me at the time was 07:11 am. Anyone know how to tune it so it is with GMT time? This post has been edited by flashy: Mar 25 2008, 07:27 AM |
|
|
|
Mar 25 2008, 07:31 AM
Post
#2
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 685 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
http://www.trap17.com/forums/php-time-difference-t56225.html A topic by me a while back. I think this is what your after just have a bit of a read.
|
|
|
|
Mar 25 2008, 07:44 AM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 60 Joined: 7-March 08 From: Swindon, England Member No.: 59,016 |
I looked at the post, but every time i tried to use those techniques it just didnt work
|
|
|
|
Mar 25 2008, 07:53 AM
Post
#4
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 685 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
Can you list some code and/or maybe the steps you are taking to handle the date? When you say it just doesn't work we have no idea what just doesn't work. The kettle doesn't work? My lines on the girls don't work? Please be a bit more specific about your problem if you wish to get better help. In your case I'm assuming your piece of code isn't doing what you want it to do so please post it so we can take a look.
|
|
|
|
Mar 25 2008, 05:15 PM
Post
#5
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 60 Joined: 7-March 08 From: Swindon, England Member No.: 59,016 |
OK i found out how to do it! I did a bit of google and this worked completely for me and it is simple.
I used this code CODE putenv("TZ=UK"); echo("h:i:s"); If you like in the United States and you live say Los Angeles you would do this... CODE putenv("TZ=US/Los_Angeles"); echo("h:i:s"); The full TimeZones are here You can set the default timezone like this: CODE date_default_timezone_set('UTC'); And you can then format it CODE <?php
// Assuming today is: March 10th, 2001, 5:16:18 pm $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm $today = date("m.d.y"); // 03.10.01 $today = date("j, n, Y"); // 10, 3, 2001 $today = date("Ymd"); // 20010310 $today = date('h-i-s, j-m-y, it is w Day z '); // 05-16-17, 10-03-01, 1631 1618 6 Fripm01 $today = date('\i\t \i\s \t\h\e jS \d\a\y.'); // It is the 10th day. $today = date("D M j G:i:s T Y"); // Sat Mar 10 15:16:08 MST 2001 $today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:17 m is month $today = date("H:i:s"); // 17:16:17 ?> |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 10th October 2008 - 08:01 PM |