Date-Ordinal

 view release on metacpan or  search on metacpan

Ordinal.pm,v  view on Meta::CPAN


2.2
date	2000.02.06.16.33.38;	author end70;	state Exp;
branches;
next	1.1;

1.1
date	2000.02.06.16.32.51;	author end70;	state Exp;
branches;
next	;


desc
@@


2.9
log
@*** empty log message ***
@
text
@#-----------------------------------------------------------------------

=head1 NAME

Date::Ordinal - Conversion of dates to ordinal numbers and vice versa

=head1 SYNOPSIS

    use Date::Ordinal;
    
    $ord     = month2ord('January');           # $ord gets 1
    $mon     = ord2month('1');                 # $mon gets 'January'
    $mon     = ord2month(1);                   # $mon gets 'January'
    $mon     = ord2month('01');                # $mon gets 'January'
    $arryref = all_month_ordinations
    @@arry    = all_month_names
    $arryref = all_month_names_ref
    $arryref = all_short_month_names_ref
    $arryref = all_day_ordinations

    $arryref = all_hour_ordinations
    $arryref = all_minute_ordinations


    $hashref = ordination_month_pair # {'01' => 'January', ... }
    @@day     = days

    
=cut

#-----------------------------------------------------------------------

package Date::Ordinal;
#use strict;

#-----------------------------------------------------------------------

=head1 DESCRIPTION

This module is designed to aid in  creation of CGI popup_menus and also
interaction with SQL databases.


=cut

#-----------------------------------------------------------------------

require Exporter;
use Carp;

#-----------------------------------------------------------------------
#	Public Global Variables
#-----------------------------------------------------------------------
use vars qw($VERSION @@ISA @@EXPORT @@EXPORT_OK);
$VERSION   = '2.9';
@@ISA       = qw(Exporter);
@@EXPORT    = qw(ord2month month2ord ordination_month_pair all_month_ordinationsall_day_ordinations all_hour_ordinations all_minute_ordinations prezero);

#-----------------------------------------------------------------------
#	Non-Private Global Variables
#-----------------------------------------------------------------------
@@month=();

#=======================================================================

=head1 CONVERSION ROUTINES

There are two conversion routines: C<ord2month()> and C<month2ord()>.

=over 8

=item ord2month()

This function takes a month number [1..12] and returns a string
which contains the name of the month identified. If the number is
not a valid number, then C<undef> will be returned:

    $mon = ord2month('3');

=item C<month2ord()>

This function takes a month name and returns the integer
corresponding to the month name, if such exists.

The match is a regexp match, so both 'Mar' and 'March' will return 3.

If the argument could not be identified as a month name,
then C<undef> will be returned:

    $ord = month2ord('March');

The case of the month name is not important.
See the section L<KNOWN BUGS AND LIMITATIONS> below.

=back

=cut

#=======================================================================
sub ord2month



( run in 1.255 second using v1.01-cache-2.11-cpan-364913b4093 )