CFLib.org – Common Function Library Project

SwatchIT()

Last updated July 05, 2002

author

B Kiefer

Version: 1 | Requires: CF5 | Library: DateLib

Description:
The goal of sIT may be commercial, but a base10 clock is wonderful. This function can be very useful in timestamps and other query string 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 Values:
Returns a string.

Example:

<!--- Remember that we cache UDF results, so output below will not change. --->
<cfoutput>
#swatchIT()#
</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * Returns the current internet time.
 * 
 * @return Returns a string. 
 * @author B Kiefer (packetsdontlie@mac.com) 
 * @version 1, July 5, 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);
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson