Swatch Internet Time
Normally, I don't really fall for stupid gimicks like Swatch Internet Time. However, I
have long been a fan of having a base 10 time system. The rest of this garbage about time zones
and the like are all fine an dandy, but a base 10 time system has awesome advantages. Having
base 10 for time of the day is a start. I'd like to replace the calendar with a base 10
calendar as well. But this is a good start I suppose. You can get full information about
Swatch's internet time at their website, http://www.swatch.com.
Here's the basic idea. There are 86400 seconds in a day:
60 seconds 60 minutes 24 hours 86400 seconds
---------- X ------------ X ---------- = -------------
1 minute 1 hour 1 day 1 day
So, Internet Time starts at 0 and works it's way up to 1000. We'll call these units
minutes. So there are 1000 minutes in a day, and each minute is 86.4 seconds.
86400 / 1000 = 86.4
To calculate Swatch Internet Time, do the following:
Get the number of seconds of the day in UTC/GMT (Universal Time) and add 3600 seconds. Divide
the result by 86.4 and you'll have the time in Swatch Internet Time (SIT... heh, what a stupid acronym).
Here's some PHP code that generates Swatch Internet Time:
/*
* note that PHP has built-in internet time functionality with the use of
* the date() command echo date("B"); will display the number of beats. I
* find the MilliBeat to be more useful, so i use this code and format it
* appropriately with printf("%2.2f", getinternettime());
*/
function getinternettime()
{
return((float) ((time()+3600) % 86400) / 86.4);
}
or C:
float getinternettime(NULL)
{
return((float) ((time(NULL)+3600) % 86400) / 86.4);
}
or PERL:
sub getinternettime
{
return(((time()+3600) % 86400) / 86.4);
}
or CFSCRIPT (submitted by Bruce Kiefer http://www.bruceandmo.com):
<cfscript>
/**
* Get current Swatch Internet Time (sIT)
* The goal of sIT may be commercial, but a base10 clock is wonderful
* Can be very useful in timestamps and other variables
* This function should self adjust for your UTC offset
* See http://www.ypass.net for PHP and Perl versions
* See http://www.swatch.com for information
*
* @return function returns a string
* @author packetsdontlie@mac.com
* @version 1, 12 April 2002
*/
function swatchIT(){
var myutc = GetTimeZoneInfo();
var beats = ((3600 + Val(Hour(now()) * 3600) + Val(Minute(now()) *
60) + Second(now()) + val(myutc.utcTotalOffset)) mod 86400) / 86.4;
return decimalformat(beats);
}
</cfscript>
You get the idea.
Mountain time conversions (currently in Daylight Savings Time):
00:00:00 = 208.33
10:00:00 = 625.00
13:00:00 = 750.00
15:00:00 = 833.33
19:00:00 = 0.00
|