Always check for local time

Despite the fact that my server timezone was set correctly, somehow time() was giving wrong ( UTC) hour. So i ended up using wp’s functions to make sure.

$now = current_time( 'timestamp', 0 ) ;$local_ts = get_the_time('U',$post->ID);