Jump to content

Matching tomorrows date in unix timestamp


brob

Recommended Posts

Hi,

I have a database that uses unix timestamps (which I can not change)

I need to be able search these timestamps for tomorrows date.

The timestamps include both date and time but I only wish to search for tomorrows date the time does not bother me.

Does anyone have any advice on how to do this?

Thanks
It is possible to use the follow:

[code]
function compare_dates($now)
{
$tom = strtotime("+1 day");
if($now > $tom)
  return true;
else
return false;
}
[/code]

In this function you will pass the $now as the unix timestamp from your db and then the function will return true if the $now date is tomorrows date and false otherwise.
Hi sorry this wont work as the time stamp for today with both date and time included i.e.

30/01/2007 00:00

is differnet from the date with a time included

30/01/2007 16:00

so I wouldn't be able to match these.

Is there someway to match just the date and exclude the time in the match?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.