NAME

Time::Beat - Module to convert between standard time and Swatch ".beat" time.

SYNOPSIS

use Time::Beat qw(beattime timebeat24 timebeat12);

my $time_in_beats = beattime(time());

my $beats_in_24hr_time = timebeat24($beat);

my $beats_in_12hr_time = timebeat12($beat);

DESCRIPTION

Time::Beat is a module to convert normal time to and from .beats, of which there are a thousand in a day. It can change normal time in time() format to .beats, and .beats into either 24-hour or 12-hour normal time.

METHODS

There are three methods in Time::Beat.

beattime [time string]

beattime will give you the current time in .beats if you do not specify a time string. If you specify a string in time() format it will return that particular time in .beats. The basic algorithm for doing this is to take the time in GMT+1 hour, convert it into seconds, and divide by 86.4.

timebeat24 [beat string]

timebeat24 takes a 3-digit beat time and outputs a 24-hour time along the lines of "12:34:56".

timebeat12 [beat string]

timebeat12 takes a 3-digit beat time and outputs a 12-hour time along the lines of "12:34:56 am" or "12:34:56 pm".

CHANGES

As of 1.1 the module can now convert to and from .beats in 12- and 24-hour format.

AUTHOR

Earle Martin <emartin@cpan.org>. Originally written by James Duncan <jduncan@fotango.com>.

SEE ALSO

DateTime::Format::IBeat, which does much the same thing as part of the DateTime project, and the .beat home page: http://www.swatch.com/itime_tools/itime.php