package Cisco::Utils::Internal::DateTime; $VERSION = 0.02.00; @EXPORT_OK = qw(DateTime); use strict; use base 'Exporter'; sub DateTime { my($sec,$min,$hour,$mday,$mon,$year) = localtime(time); my $datetime = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $year+1900,$mon+1,$mday,$hour,$min,$sec ); } 1; =head1 NAME DateTime =head1 SYNOPSIS DateTime is intended for use by Cisco::Utils modules. It's not meant for use directly from Perl scripts, and it's interface may change at any time without notice. DateTime accepts no arguments, and returns a scalar containing year, month, mday, hour, minute, second in human-readable format. YYYY-MM-DD hh:mm:ss #!/usr/bin/perl -w use strict; use Cisco::Utils::Internal::DateTime qw(DateTime); my $datetime = DateTime() or die "Error: $!"; print "$datetime\n"; =head1 UPDATE 2001-11-18 07:40 CDT Original working code. =head1 TODO Figure out enough h2xs to package this module for distribution. =head1 BUGS None that I know of. =head1 REQUIRES Nothing aside from Perl itself. =head1 AUTHOR ybiC =head1 CREDITS Thanks to Petruchio for kickstarting me into modulitazing my Ciscoey scripts. And to vroom for PerlMonks. =cut