Jump to content


Photo

Timestamp of future dates


  • Please log in to reply
5 replies to this topic

#1 flOid

flOid
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 19 June 2006 - 07:19 PM

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

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 19 June 2006 - 07:28 PM

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

#3 flOid

flOid
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 19 June 2006 - 07:34 PM

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.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 19 June 2006 - 07:38 PM

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");

#5 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 20 June 2006 - 12:17 AM

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.
~ D Kuang

#6 flOid

flOid
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 June 2006 - 01:21 AM

thanx everyone, actually the strtotime function was what I was looking for.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users