Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Date and time--recommended module?
November 8, 2006, 8:41 pm
rate this thread
I am looking for a module to use for date and time string manipulations.
I want something that can recognize most of the various date/time strings
in common useage, perform calculations, and so on.
I have checked the FAQ but I see no recommendations there.
CPAN offers quite a few, but I don't know which is most commonly
used and recommended.
Re: Date and time--recommended module?
On Wed, 08 Nov 2006 12:41:30 -0800, Mark wrote:
I use the following code, instead of a specific module.
@now = gmtime(time);
# for YYYYMMDD format
$now_date = sprintf("%04d%02d%02d", $now+1900, $now+1, $now);
# for YYYYMMDDhhmmss format
$now_time = sprintf("%04d%02d%02d%02d%0d%02d", $now+1900, $now+1, $now,
$now, $now, $now);
If you work with/store dates this way, it makes it easy to do a lot of things
with the dates.
Hope this helps...
- Gunnar Hjalmarsson
November 8, 2006, 9:01 pm
- » building GD using a locally-installed libgd (old libgd also present on system)
- — Next thread in » PERL Modules Announcements