Using date('B') for the Swatch Internet Time (i.Beats) can still lead to misunderstandings, because the date given in the resulting string is the local date, not the date of the BMT (Biel Mean Time / UTC+0100) after which the i.Beats are counted. So while @000 is equal all around the globe, October 25th, 2005 @000 is really October 24th, 06:00 PM in Chicago local time. So if you use date('d M Y @B') in Chicago on that day at 6pm, it will return ”24 Oct 2005 @000” although it should be ”25 Oct 2005 @000”.
Therefore it may happen that you miss an appointment by 24 hours (or 1000 Beats). Here's a way to return the Internet Time with correct date:
$curtime = time(); $utcdiff = date('Z', $curtime); // get difference to UTC in seconds $bmttime = $curtime - $utcdiff + 3600; // BMT = UTC+0100 $ssm = date('H', $bmttime)*3600 + date('i', $bmttime)*60 + date('s', $bmttime); // seconds since midnight (BMT) $ibeats = $ssm/86.4; // 86400 seconds = 1000 beats, so 1 beat = 86.4 seconds echo 'i.Beats : ' . date('D, d M Y', $bmttime) . ' @' . $ibeats;
Note: If you would try date('D, d M Y @B', $bmttime), the resulting beats would be wrong because the timezone used for calculation of the beats within the date() function is still your local one but the timestamp is UTC+0100.
Another working way would be:
$curtime = time(); $utcdiff = date('Z', $curtime); // get difference to UTC in seconds $bmttime = $curtime - $utcdiff + 3600; // BMT = UTC+0100 echo 'i.Beats : ' . date('D, d M Y', $bmttime) . ' @' . date('B', $curtime);
But this way there are no floating-point beats possible, which may be handy sometimes.