PHP Date Format Posted: 2010-10-18 19:09
Reply |
Quote
CodeLimit
Member for: 4305 days Status: Offline
#10626
( F jS, Y g:i:s a )
This is the date format that I'm using. "O" is supposed to be difference to Greenwich time, but I can't get it to work.
My time zone is (-0700).
Posted: 2010-10-18 19:53 (Last Edited: 2010-10-18 19:55 )
Reply |
Quote
Delek
Member for: 4343 days Status: Offline
#10627
I don't understand what you can't get to work.
If you want to print your timezone, you can use:
echo date( "M d Y H:i:s O" );
And this line will prints, for example:
"Oct 18 2010 22:00:00 -0700"
Or you can use gmdate() function, its identical to the date() function except that the time returned is GMT.
Regards, Delek.
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
CodeLimit
Member for: 4305 days Status: Offline
#10628
Whenever I enter echo date( "M d Y H:i:s O" ); it tells me that I've exceeded the character limit. And when I put in ( M d Y H:i:s O ), it gives me Oct 18 2010 20:16:50 +0200, and that's not right. It's supposed to be -0700, right?
Delek
Member for: 4343 days Status: Offline
#10629
Where's your server?, remember that PHP runs server side.
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
CodeLimit
Member for: 4305 days Status: Offline
#10630
I...don't know what that is. I'm using Firefox on Windows 7.
Posted: 2010-10-18 20:38 (Last Edited: 2010-10-18 20:41 )
Reply |
Quote
Delek
Member for: 4343 days Status: Offline
#10631
PHP runs on a server, you need a local server (with Abyss Web Server for example), or a real one (www.codelimit.com for example).
Your site its online?.
If your server its in China, it will print the GMT of china, that's what i'm trying to say. Perhaps for this reason php shows a different time zone than you expect
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
CodeLimit
Member for: 4305 days Status: Offline
#10632
I don't have a site. I'm trying to adjust the date function on [i]this[/i] site. FamiTracker.shoodot.net
CodeLimit
Member for: 4305 days Status: Offline
#10633
But I'm not in China, I'm in [i]Arizona.[/i] I'm trying to get Arizona Time.
Posted: 2010-10-18 20:51 (Last Edited: 2010-10-18 20:51 )
Reply |
Quote
Delek
Member for: 4343 days Status: Offline
#10634
www.shoodot.net (IP address 91.191.136.207) is assigned to Great Britain (UK).
I think that date function must return +0100 or +0200. (U.K GMT)
Why you are expect -0700?
PD: You're not in china, i know my friend, but your server its in another place than yours.
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
Delek
Member for: 4343 days Status: Offline
#10635
You can use date_default_timezone_set(), i don't know if Arizona its in the supported list, but you can use another city with your desired timezone.
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
Posted: 2010-10-18 21:17 (Last Edited: 2010-10-18 21:18 )
Reply |
Quote
Delek
Member for: 4343 days Status: Offline
#10636
I think that this will solve your problem.
date_default_timezone_set('America/Santiago');
Santiago is also -0700.
_______________________
[url=http://www.delek.com.ar/]Delek's Website
[url=http://www.delek.com.ar/deflemask]DefleMask Tracker
[url=http://soundcloud.com/delek_music]Delek's SoundCloud
[url=http://www.youtube.com/dele1000]Delek's YouTube Channel
CodeLimit
Member for: 4305 days Status: Offline
#10637
Thanks.