- date_default_timezone_set: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
date_default_timezone_set('Europe/Prague');
$t = 1414754455; // 31.10.2014 # time() - 24*60*60; // yesterday
$t1 = strtotime("actual month", $t);
$t2 = strtotime("first day of next month", $t);
echo date("d.m.Y", $t) . ": $t\n";
echo date("d.m.Y", $t1) . ": $t1\n";
echo date("d.m.Y", $t2) . ": $t2\n";
echo "DIFF: " . ($t1-$t2);