Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Working with Date & Time

Codes here !

Moderators: macek, egami, gesf

Postby Flood » Thu Jun 26, 2003 3:08 pm

Hej!

How about

Code: Select all
<?php
  $begin_date = strtotime("2003-06-18 13:10:10");
  $end_date   = strtotime("2003-06-28 14:10:10");

  print floor(($end_date - $begin_date) / 3600 / 24);
?>


Sure you can optimize it a little bit by computing 3600 * 24 in advance... But it works fine!

/Flood
Flood
New php-forum User
New php-forum User
 
Posts: 23
Joined: Tue Jun 24, 2003 4:49 am

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron