Jump to content


Photo

Stupid Noobie date() question


  • Please log in to reply
3 replies to this topic

#1 andie

andie
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 March 2006 - 08:26 PM

Ok, Im so new at this its disgusting.

I have a simple script that runs on my WordPress blog to track IP's of visitors.

The problem is that the time returns on the log to some other crazy timezone (my server's I think?).

I would like the log to report back to me the time offset for where I am at...PDT (GMT -8).

Here is what the script says for the date() function:

$date = date ("d/m/y g:i a");

Thanks!

#2 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 13 March 2006 - 08:34 PM

Simply do this:

$date = date("d/m/y ");
$date .= date("G") - 8;
$date .= date(":i:s");

echo $date;

OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#3 andie

andie
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 March 2006 - 09:04 PM

[!--quoteo(post=354647:date=Mar 13 2006, 12:34 PM:name=Gast)--][div class=\'quotetop\']QUOTE(Gast @ Mar 13 2006, 12:34 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Simply do this:

$date = date("d/m/y ");
$date .= date("G") - 8;
$date .= date(":i:s");

echo $date;
[/quote]

AWESOME! Thank you so much! It worked!

#4 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 13 March 2006 - 09:56 PM

no problem :)
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users