Reputation: 6199
I am tring to get a set time timestamp for e.g
if I input the follow time 09:00 i want to see the timestamp for today
function GetTimestamp($time){
date();
}
return GetTimestamp("09:00")
can someone help me please or lead me down the right path
Upvotes: 0
Views: 208
Reputation: 401182
You just have to use the strtotime()
function, passing it your time :
$ts = strtotime('09:00');
var_dump($ts);
And you'll get :
int 1300435200
$dt = new DateTime('09:00');
$ts = $dt->format('U');
var_dump($ts);
Upvotes: 3