interval of sets

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sat Feb 01, 2003 2:04 pm

It depends on the time format.
Tell us what you have in the database and wich format you want for the resulting data.

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Tue Feb 04, 2003 10:28 am

You can use this function in many ways.
I think this is what you are looking for:

Code: Select all

<?php 
//different format options, choose whatever you need
echo "<b>time() function: </b>".time()." <b>is the same as  strtotime ('now') function: </b>"; echo strtotime ("now"), "<br>";
echo ( strtotime ("12 March 2003") - strtotime ("now") )."<br>";
echo strtotime ("10 September 2000"), "<br>";
echo strtotime ("+1 week"), "<br>";
echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "<br>";
echo strtotime ("next Thursday"), "<br>";
echo strtotime ("last Monday"), "<br>";
?>

I hope it helps!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests