php - Getting midnight timestamp value from specific timestamp -


i want calculate midnight value timestamp. example 1461043742 today's timestamp, want timestamp of midnight 12'o clock timestamp value. , 1461130928 tomorrow's timestamp want show tomorrow midnight 12'o clock timestamp value. how can this, there possibility achieve in php?

you can use strtotime:

// input: $now = 1461043742;  // calculate: $midnight = strtotime("midnight", $now); $midnight_tomorrow = strtotime("midnight tomorrow", $now);  // test print(date('c', $midnight)); print(date('c', $midnight_tomorrow)); 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -