System Time

Page 1 of 1

6 Replies - 3830 Views - Last Post: 23 August 2010 - 12:18 AM Rate Topic: -----

#1 antiturncoat  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 08-August 07

System Time

Posted 11 August 2007 - 07:02 AM

Guys I need help in getting the system time using php for my web... Thanks!!!
Is This A Good Question/Topic? 0
  • +

Replies To: System Time

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: System Time

Posted 11 August 2007 - 09:58 AM

http://ca3.php.net/time

http://www.w3schools...hp_ref_date.asp

http://ca.php.net/date

http://ca3.php.net/m...n.microtime.php
Was This Post Helpful? 0
  • +
  • -

#3 antiturncoat  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 08-August 07

Re: System Time

Posted 11 August 2007 - 02:12 PM

thanks that was handy... really appreciate it
Was This Post Helpful? 0
  • +
  • -

#4 antiturncoat  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 99
  • Joined: 08-August 07

Re: System Time

Posted 17 September 2007 - 07:15 PM

getting the system time with the pattern of year/month/date

$date=date('Y-m-d');


Was This Post Helpful? 0
  • +
  • -

#5 Guest_Shine Developers*


Reputation:

Re: System Time

Posted 22 August 2010 - 11:50 PM

View Postantiturncoat, on 11 August 2007 - 06:02 AM, said:

Guys I need help in getting the system time using php for my web... Thanks!!!

Was This Post Helpful? 0

#6 Guest_Shine Developers*


Reputation:

Re: System Time

Posted 22 August 2010 - 11:52 PM

<?php
$time_now=mktime(date('h')+5,date('i')+30,date('s'));
$date = date('d-F-Y h:i:s A',$time_now);
echo $date;
?>
Add above code to your php document. It will your system's data and time
Was This Post Helpful? -1

#7 guahguahmonster  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 68
  • View blog
  • Posts: 209
  • Joined: 29-August 07

Re: System Time

Posted 23 August 2010 - 12:18 AM

View PostShine Developers, on 22 August 2010 - 10:52 PM, said:

$time_now=mktime(date('h')+5,date('i')+30,date('s'));



1. Please use code tags. You did not do so in your post.
2. Please do not necro-post.
3. Your code makes an extraordinarily bad assumption that all people who will see that page are in a time zone that happens to be 5 hours and 30 minutes ahead of the time zone of the server. This seems very very unwise.

(If we're interested in this discussion, the only ways I know of to figure out the user's time zone are using Javascript or simply asking the user. Any others out there?)

Edit: Argh. Didn't even notice this was necro-posted the first time around. Post edited. Fail.

This post has been edited by guahguahmonster: 23 August 2010 - 12:25 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1