Coding Domain

Perl Modules: Time::Text


Downloads
Perl Modules
Name
Time::Text - Displaying time as text

Synopsis
# Importing methods.
use Time::Text;
use Time::Text qw(English);
use Time::Text qw(Dutch);

# Method Calling
print localtimestr();
print localtimestr(time + 60);
print gmtimestr();

Description
This module provides two methods to work with time-strings in your program. In fact, the result is exactly as when calling the localtime() and gmtime() functions in a scalar context. However, this module accepts a language parameter when importing. This turns the strings produced by the functions also appear in that specific language.

This module attempts to load the language specified (or english by default) from a Time::Text::LanguageName module.

Exported Functions
localtimestr([TIME]), gmtimestr([TIME])
Behaves exactly like the build-in functions gmtime() and localtime(), called in a scalar context.

@Time::Text::Days, @Time::Text::ShortMonths, @Time::Text::LongMonths
These array's are filled with the language-specific strings loaded when the module is imported. They are used by the exported functions.

Author
Copyright (c) 2001, Diederik van der Boor - All Rights Reserved