date ("d.m.Y ( h:i A )")
The date is fine bit This shows me 1:25 AM when it’s 6:25 AM GMT
How do I get it to show the GTM time?
Oh and how to put “GMT” after it?
date ("d.m.Y ( h:i A )")
The date is fine bit This shows me 1:25 AM when it’s 6:25 AM GMT
How do I get it to show the GTM time?
Oh and how to put “GMT” after it?
Does this help at all?
umm… that’s where I got the dam function! so me thinks me not findink solution from deer!
I’m pretty sure that the date() function displays the server time, so I guess you could figure out what the server time is and add or subtract the hours to your hours thing. That would be a messy solution though because if it was like 12 o’clock for instance, it might show up as 16. or 24 could be 28. You should probably use javascript because it gets the users time, not the servers.
If I’m wrong in all this just tell me, but I’m pretty sure thats how it works
well I dunno! But I think the user time would be no good since I’m using that in a guestbook. All the timezones are different so… that wouldn’t work well…
the date() function in PHP displays the server time since it is a server side script. Do you want it to show the time from your timezone? you would have to get the hour separately and then add to it, and then combine the strings…
<?
$tz = 3;
$hour = date("g");
$time = date(":i");
$hour = $hour + $tz;
$realTime = $hour.$time;
print $realTime;
?>
Where $tz is your timezone offset. Determine the time of your server and then subtract your current time and you’ll get your offset.
hm… it should be gmt cuz it’s a guestbook… Different ppl sig to a guestbook & different ppl live in different timezones so all the times would be messed up.
I can replace “$tz” with a number to get Gmt yes? Would that work?
Thanks for chiming in Jubba. Im not hip on my PHP, but now that I am on a server that supports more PHP than my last server I will be hopefully be learning it more
Syko: yeah. Determine what time your server is on, and then figure out what time GMT is and subtract to figure it out. That should work. You’ll have to edit things around of course because thats probably not the format that you wnat or anything, but I’m sure you can figure that all out. If you need anything else just ask away.
Lib: If you ever need any PHP help just let me know. You know my AIM screen name… just give me a shout.
I will do Jubba, thank you for the offer I am so glad to finally be on a server where I can do actual PHP (my last server only allowed limited PHP like mailforms and stuff)
I love PHP. I wish I could show you the admin panel I just created for my friends band site. I’m pretty proud of it because they loved it. They can control everything about the site from that page.
WOW… I need me one of those thingamabobbers! Ok I don’t, but I have a friend that would love one of those…lol.
:: Copyright KIRUPA 2024 //--