Re: Date and time--recommended module?
am 08.11.2006 15:42:53 von turajb
On Wed, 08 Nov 2006 12:41:30 -0800, Mark wrote:
> Hello.
>
> 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.
>
> Suggestions?
>
> Thanks
> -Mark
I use the following code, instead of a specific module.
@now = gmtime(time);
# for YYYYMMDD format
$now_date = sprintf("%04d%02d%02d", $now[5]+1900, $now[4]+1, $now[3]);
# for YYYYMMDDhhmmss format
$now_time = sprintf("%04d%02d%02d%02d%0d%02d", $now[5]+1900, $now[4]+1, $now[3], $now[2], $now[1], $now[0]);
If you work with/store dates this way, it makes it easy to do a lot of things with the dates.
Hope this helps...
Date and time--recommended module?
am 08.11.2006 21:41:30 von mark
Hello.
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.
Suggestions?
Thanks
-Mark
Re: Date and time--recommended module?
am 08.11.2006 22:01:18 von Gunnar Hjalmarsson
Mark wrote:
> 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.
This article provides some guidance:
http://www.perl.com/pub/a/2003/03/13/datetime.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: Date and time--recommended module?
am 08.11.2006 22:04:26 von John Bokma
"Mark" wrote:
> Hello.
>
> 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.
>
> Suggestions?
Read this first:
%3A%3AMANIP>
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/