- floor: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
- define: documentation ( source)
- sprintf: documentation ( source)
<?php
define('ROTATE_PERIOD', 2);
echo date('Y_m_d_H_') . sprintf("%02d", (floor(date('i') / ROTATE_PERIOD) * ROTATE_PERIOD));
echo "\n";
echo date('Y_m_d_H_', strtotime( '' ));
echo "\n";
echo sprintf("%05d", (floor(date('i', strtotime( '-13 minutes' )) / ROTATE_PERIOD) * ROTATE_PERIOD));
echo "\n";
echo strtotime( '-1 days' );