Jump to content

Archived

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

flOid

Timestamp of future dates

Recommended Posts

Could someone provide me the code for outputting a timestamp of a given future time within the same day? Thanx a lot in advance!

Share this post


Link to post
Share on other sites
I don't quite understand your question. Outputting a timestamp is the same whether the date/time is in the past, present, or future.

Ken

Share this post


Link to post
Share on other sites
Sorry, PHP and programming newbie here.

I learned about the time() function, but what I need is not the current time, but the code to output the Unix timestamp of a defined future time within the same day.

Share this post


Link to post
Share on other sites
What do you by the same day? To get the times stamp of a future date do this:

echo strtotime("+1 day");
echo strtotime("+1 week");

Or

echo strtotime("25 December 2006");

Share this post


Link to post
Share on other sites
mktime:
[a href=\"http://www.php.net/mktime\" target=\"_blank\"]http://www.php.net/mktime[/a]

It doesn't matter if it's from past, present or future.

Share this post


Link to post
Share on other sites
thanx everyone, actually the strtotime function was what I was looking for.

Share this post


Link to post
Share on other sites

×

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.