# Copyright (c) 1995-2009 Graham Barr. This program is free # software; you can redistribute it and/or modify it under the same terms # as Perl itself. package Date::Format; use strict; require Exporter; our $VERSION = '2.35'; # VERSION: generated # ABSTRACT: Date formatting subroutines use Date::Format::Generic; our @ISA = qw(Exporter); our @EXPORT = qw(time2str strftime ctime asctime); sub time2str ($;$$$) { my ($fmt, $time, $zone, $lang) = @_; my $pkg = defined $lang ? do { require Date::Language; Date::Language->new($lang) } : 'Date::Format::Generic'; $pkg->time2str($fmt, $time, $zone); } sub strftime ($\@;$) { Date::Format::Generic->strftime(@_); } sub ctime ($;$) { my ($t,$tz) = @_; Date::Format::Generic->time2str("%a %b %e %T %Y\n", $t, $tz); } sub asctime (\@;$) { my ($t,$tz) = @_; Date::Format::Generic->strftime("%a %b %e %T %Y\n", $t, $tz); } 1; __END__ =pod =encoding UTF-8 =head1 NAME Date::Format - Date formatting subroutines =head1 VERSION version 2.35 =head1 SYNOPSIS use Date::Format; my @lt = localtime(time); my $template = "...."; print time2str($template, time); print strftime($template, @lt); my $zone; print time2str($template, time, $zone); print strftime($template, @lt, $zone); print ctime(time); print asctime(@lt); print ctime(time, $zone); print asctime(@lt, $zone); =head1 DESCRIPTION This module provides routines to format dates into ASCII strings. They correspond to the C library routines C and C. =over 4 =item time2str(TEMPLATE, TIME [, ZONE [, LANGUAGE]]) C converts C