getting timestamp in php
Asked Answered
B

2

0

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

Brelje answered 23/1, 2011 at 8:36 Comment(0)
M
3
$hr = 10;
echo strtotime("today +$hr hours");
Malka answered 23/1, 2011 at 8:41 Comment(0)
O
4

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

Oratorical answered 23/1, 2011 at 8:40 Comment(0)
M
3
$hr = 10;
echo strtotime("today +$hr hours");
Malka answered 23/1, 2011 at 8:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.