As a matter of fact YES i did test your code. And for the record it was not a blast of your abilities- I really don't know what your abilities are nor do i really care. I thought the point of this forum was to post relevant information. That link I provided gives an EXCELLENT free script that used very little code to accomplish the same thing, and SOME people just MIGHT find it useful. You don't need to get the hair on your back all stood up just b/c someone makes an honest attempt to help someone else out on the forum.
So in effect I "BLURTED" out what I did with all good intentions.
Here's what I did initially testing your code, and I just tried it again with the same results:
Right now the system clock of the server I am using is at:
6:56 PM, Wed. Dec 5 2001
I trimmed the line you submitted down from this:
$yourdate = date("g:i:s a m-d-Y", mktime(date("g") + 1, date("i"), date("s"), date("m"), date("d"), date("Y")));
to this:
$yourdate = date("g:i:s a m-d-Y");
which yielded this when it hit the screen:
6:56:08 pm 12-05-2001 (the correct current time and date)
Then I switched back to the original line of code you provided which i assume was supposed to add an hour to the server time and got this result:
7:56:24 am 12-05-2001 (+1 correctly added to the hour, but switched to am)
I understand there should be + 1 added to the hour, but what is up with that AM...Now all i did was "echo" your variable to the
screen...I didn't touch or change your code in any way. I'm not going to waste anymore time messing with it, but that's exactly what happened to me before, and since it just happened to be between 11 PM and 12 AM when I tested it, i assumed (wrongly) that that was the only time it messed up, was on hours where the AM to PM change occurred.
I'm running this PHP server on a Windows platform, and maybe that would have something to do with the problem - I don't know and again don't really care. Even if the problem is associated with the platform it's running on (windows) don't you think some people might actually want to implement that code on a windows platform? You never know.
Now I don't claim to be a damn expert but I know what I saw - You can attribute it to whatever you want- I couldn't care less.
And as far the issue of did i realize that it had already been posted a year ago....YES ! Don't tell me you've NEVER come to this site and found the answer you needed by referring back to OLD postings. THAT'S the reason i posted the article I found - it was very helpful and was an exact fix for the problem. I was proactively imagining a scenario where a user just MIGHT come to the site and type in "Time Zone" or something stupid like that, in the event that they were having problems related to .... guess what .... TIME ZONE issues! ... They would see your fix, but they would ALSO see my link posted, and then THEY could make the decision on their own. You need to learn not to take crap so personal.
As a matter of fact, to further illustrate this last point, notice the text that appears just above the "Press once to submit" button on these pages. It says "Please do a search BEFORE posting." That's exactly why I posted the link - just in case someone had enough sense to search before posting.
somewhat respectfully,
mark