Jump to content

Date problem


Nuker_Viper
 Share

Recommended Posts

i don't quite understand why it displays this:

Thursday, December 6, 2012 - 3:32 PM - PM12UTCThu, 06 Dec 2012 15:32:27 +0000322012-12-06T15:32:27+00:00pm/4UTC4_20122012Thu, 06 Dec 2012 15:32:27 +0000k
here is the basic code...
<?php$TZ = getTZInfo("tz", getMemberInfo("timezone", $membername));$T = getTZInfo("tz_plusminus_hours", getMemberInfo("timezone", $membername));$DST = getMemberInfo("timezone_dst", $membername); if($DST == "On") { $D = "1"; }else { $D = "0"; } $TF = ($T+$D); if($logged_in == "1") { $displaydate = gmdate("l, F j, Y - g:i A - $TZ", time()+(("$TF"+date("I"))*3600)); }elseif($logged_in != "1") { $displaydate = gmdate("l, F j, Y - g:i A - e", time()+((-5+date("I"))*3600)); } ?>

Edited by Nuker_Viper
Link to comment
Share on other sites

Are you sure? Are you assuming that's what it is or did you print it to check? It might be a good idea to print the whole date format string you're sending to gmdate. If it's running the first part of the if statement, and $TZ is set to "-5", then "-5" should show up in the output but I don't see it there. If it's set to "America / New York", on the other hand, that would explain the output if you're passing this to gmdate: l, F j, Y - g:i A - America/New York The "A" in America is AM/PM, and I see it printing PM there. "m" is month, and there's a 12 after the PM. You can even see the "/" in the output between lowercase pm and "4".

Link to comment
Share on other sites

yea when i took out the $TZ the format works. $TZ is just tell you your current time zone your proflle is set to.. so if i add it at the end of the date info it will appear as just an text output?

Edited by Nuker_Viper
Link to comment
Share on other sites

<?php$TZ = getTZInfo("tz", getMemberInfo("timezone", $membername));$T = getTZInfo("tz_plusminus_hours", getMemberInfo("timezone", $membername));$DST = getMemberInfo("timezone_dst", $membername);if($DST == "On") { $D = "1"; }else { $D = ")"; }$TF = ($T+$D);if($logged_in == "1") { $displaydate1 = date("l, F j, Y - g:i A", time()+(($TF+date("I"))*3600)); $displaydate = "$displaydate1 - $TZ"; }elseif($logged_in != "1") { $displaydate1 = date("l, F j, Y - g:i A", time()+((-5+date("I"))*3600)); $displaydate = "$displaydate1 - EST"; }?>

Output:

Thursday, December 6, 2012 - 9:19 AM - America/Los_Angeles
ok nvm not perfectly.. time is off it is suppose to -8 and its -2 ??? and the AM / PM thing is wrong... Edited by Nuker_Viper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...