| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > php/sql - Making sure value of $time is GMT |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
php/sql - Making sure value of $time is GMT
I'm just starting out in php so this might be really simple. I have this bit of php/SQL Code:
Instead of giving $time the value of now(), how do I make sure it's GMT? TIA Jamie That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
|
|
#2 (permalink) |
|
Barney army!
Join Date: Mar 2003
Location: London
Posts: 696
|
ASP is my thing, but I would imagine there is a PHP equivalent - if I wanted to be certain my time was displayed in GMT, I'd explicitly set the Locale ID at the top of the page for the UK, overiding the server, but if you know your server ID is set to the UK you shouldn't need to do this: <%@LANGUAGE="VBScript", LCID=2057%> Luke Redpath .::. Software Engineer .::. Reevoo - Real Reviews From Real Customers
|
|
|
|
#3 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
Whe I use now() the time is coming up as 5 hours behind so I guess the server is on the east coast of america. I'll look into the php equivalent of your suggestion. Cheers Luke. Jamie That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
#4 (permalink) |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,632
|
This might be no help at all as I don't know php, but when I last used it I had to make changes to the date/time and figured it out with these pages: Hope that helps you somehow |
|
|
|
#5 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
I found this which I think is the equivalent to Luke's suggestion. Code:
I think I've played around so much with it though that I've changed something I shouldn't have! Now the date and time are just coming up as 0000-00-00 00:00:00! I'm gonna leave it for now and come back later. I'd end up clubbing the monitor if I don't! :smash: That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
#7 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
I was trying to do it back in April When now() is stored in the database it's the server time, not GMT. The server is in the US -5 hours behind the UK so I want to either store the time in the database as now() +5hours or display it as Time + 5hours. The former would be preferable. That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
![]() |