php - Compare timestamp to date -


i need compare timestamp date. compare date portion without time bit. need check whether timestamp occurs on day before yesterday i.e. today - 2.

could show me snippet please? thank you.

i've been reading through php docs couldn't find clean way of doing this. found converting timestamp date particular format , comparing date doing time delta date before yesterday , converting particular format. messy.

you can arcieve using function strtotime.

to round day personaly edit timestamp. notations of seconds since epoch. 1 day 86400 seconds, if following caculation:

$time = $time - ( $time  % 86400 ); 

you can convert date again date function of php, example:

$readableformat = date( 'd-m-y', $time ); 

there on internet topic.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -