hd.
hd.

Reputation: 18306

getting timestamp in php

How can I get the timestamp of a desired hour? The hour is in a variable that the user set.

Upvotes: 0

Views: 1572

Answers (2)

zerkms
zerkms

Reputation: 254906

$hr = 10;
echo strtotime("today +$hr hours");

Upvotes: 3

Kel
Kel

Reputation: 7780

You can use mktime() function to build timestamp of any datetime.

Upvotes: 4

Related Questions