pkg://perl-DateManip-5.42a-3.src.rpm:140037/DateManip-5.42a.tar.gz
info downloads
DateManip-5.42a/ 0040755 0005100 0000104 00000000000 07701034571 012254 5 ustar sbeck apps DateManip-5.42a/t/ 0040755 0005100 0000104 00000000000 07701034477 012524 5 ustar sbeck apps DateManip-5.42a/t/date_date_0.t 0100755 0005100 0000104 00000002154 06515134121 015031 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=11;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Jan 1 1996 12:00:00
Jan 1 1996 14:30:30
+0:0:0:0:2:30:30
Jan 1 1996 14:30:30
Jan 1 1996 12:00:00
-0:0:0:0:2:30:30
Jan 1 1996 12:00:00
Jan 2 1996 14:30:30
+0:0:0:1:2:30:30
Jan 2 1996 14:30:30
Jan 1 1996 12:00:00
-0:0:0:1:2:30:30
Jan 1 1996 12:00:00
Jan 2 1996 10:30:30
+0:0:0:0:22:30:30
Jan 2 1996 10:30:30
Jan 1 1996 12:00:00
-0:0:0:0:22:30:30
Jan 1 1996 12:00:00
Jan 2 1997 10:30:30
+0:0:52:2:22:30:30
Jan 2 1997 10:30:30
Jan 1 1996 12:00:00
-0:0:52:2:22:30:30
Jan 1st 1997 00:00:01
Feb 1st 1997 00:00:00
+0:0:4:2:23:59:59
Jan 1st 1997 00:00:01
Mar 1st 1997 00:00:00
+0:0:8:2:23:59:59
Jan 1st 1997 00:00:01
Mar 1st 1998 00:00:00
+0:0:60:3:23:59:59
";
print "DateCalc (date,date,exact)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,0);
1;
DateManip-5.42a/t/Manip.cnf 0100644 0005100 0000104 00000006651 07477201766 014274 0 ustar sbeck apps ################################
# CONFIG VARIABLES
################################
# See Date::Manip man page for a description of all config variables.
EraseHolidays =
PersonalCnf = Manip.cnf
PersonalCnfPath = t:.
Language = English
DateFormat = US
TZ = EST
ConvTZ = EST
Internal = 0
FirstDay = 1
WorkWeekBeg = 1
WorkWeekEnd = 5
WorkDay24Hr = 0
WorkDayBeg = 08:00
WorkDayEnd = 17:00
TomorrowFirst = 1
DeltaSigns = 0
Jan1Week1 = 0
YYtoYYYY = 89
UpdateCurrTZ = 0
IntCharSet = 0
#ForceDate =
################################
# HOLIDAYS
################################
*HOLIDAY
# Make sure that the date part of every date can be followed by the year
# and be correctly parsed by ParseDate.
# The following holiday definitions are taken from pcal's config file.
# Some are commented out if these tend to be ordinary business days.
1/1 = New Year's Day
third Monday in Feb = Presidents' Day
# 2/14 = Valentine's Day
# 3/17 = St. Patrick's Day
last Monday in May = Memorial Day
# 6/14 = Flag Day
7/4 = Independence Day
1st Monday in Sep = Labor Day
second Monday in Oct = Columbus Day (observed)
# 10/31 = Halloween
#second Mon in Nov = Veterans' Day (observed)
fourth Thu in Nov = Thanksgiving
# 12/24 = Christmas Eve
12/25 = Christmas
# 12/31 = New Year's Eve
# You can also use recurrences.
1*0:0:0:0:0:0*EASTER = Easter
1*11:0:11:0:0:0*CWD = Veteran's Day (observed)
#1*0:0:0:0:0:0*EASTER,PD5 = Good Friday
# Other complex holidays (date + delta, date - delta)
# first Monday in Nov + 1 day = Election day
# The Friday after Thanksgiving is an unnamed holiday some places
# fourth Thu in Nov + 1 day =
# State specific holidays (set for Florida)
# Except AZ, NH, MT
3rd Monday in Jan = Martin Luther King Day
# Alaska
#first Sat in March = Iditarod starts
# Only for MA, ME
#3rd Monday in Apr = Patriots' Day
# You can define specific holidays for specific years
# 1/5/1999 = A one-year-only holiday
# 1st Monday in Sep 1998 = Another one.
6/2/1999 = A special test holiday for 1999
################################
# EVENTS
################################
*EVENTS
# These are events that occur over a range of time. Useful for scheduling
# or calendar applications.
# Forms include
# date = event # Sets an event lasting 1 day or 1 hour (if no time)
2000-02-01 = Event1
2000-05-01 = Event2
2000-04-01-12:00:00 = Event3
# recur = event # Sets a recurring event lasting 1 day or 1 hour
1*01:0:10:0:0:0 = Recurring event 1 day long
1*02:0:10:12:0:0 = Recurring event 1 hour long
# date0 ; date1 = event # Sets an event lasting from date0 to date1 inclusive
# (i.e. if date1 doesn't contain a a time, it ends at
# midnight of that date)
2000-01-01 ; 2000-03-21 = Winter
2000-03-22 ; 2000-06-21 = Spring
2000-06-22 ; 2000-09-21 = Summer
2000-09-22 ; 2000-12-21 = Fall
2000-12-22 ; 2000-12-31 = Winter
# recur ; delta = event # Sets an event of this duration
1*03:0:10:12:0:0 ; 0:0:0:0:2:30:0 = Recurring event 2:30 long
DateManip-5.42a/t/date.t 0100755 0005100 0000104 00000026174 07677066744 013656 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=240;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"ForceDate=1997-03-08-12:30:00");
($currS,$currMN,$currH,$currD,$currM,$currY)=("00","30","12","08","03","1997");
$today="$currY$currM$currD$currH:$currMN:$currS";
$todaydate ="$currY$currM$currD";
$yesterdaydate="$currY$currM". $currD-1;
$tomorrowdate ="$currY$currM". $currD+1;
$yesterday ="$yesterdaydate$currH:$currMN:$currS";
$tomorrow ="$tomorrowdate$currH:$currMN:$currS";
$dates="
# Test built in strings like today and yesterday. A few may fail on a
# slow computer. On the 1st or last day of the month, the yesterday/today
# test will fail because of the simplicity of the test.
now
>Ignore failure on a slow computer.
~$today
today
>Ignore failure on a slow computer.
~$today
yesterday
>Ignore failure on a slow computer or on the 1st day of the month.
~$yesterday
tomorrow
>Ignore failure on a slow computer or on the last day of the month.
~$tomorrow
today at 4:00
$todaydate 04:00:00
today at 4:00 pm
$todaydate 16:00:00
today at 16:00:00:05
$todaydate 16:00:00
today at 12:00 am
$todaydate 00:00:00
today at 12:00 GMT
$todaydate 07:00:00
today at 4:00 PST
$todaydate 07:00:00
today at 4:00 -0800
$todaydate 07:00:00
today at noon
$todaydate 12:00:00
tomorrow at noon
>Ignore failure on a slow computer or on the last day of the month.
$tomorrowdate 12:00:00
1 month ago
1997020812:30:00
# Test weeks
22nd sunday
1997060100:00:00
97W227
1997060100:00:00
1997W22-7
1997060100:00:00
1997W23
1997060200:00:00
1997023
1997012300:00:00
1997035
1997020400:00:00
97-035
1997020400:00:00
97035
1997020400:00:00
twenty-second sunday 1996
1996060200:00:00
22 sunday in 1996
1996060200:00:00
22nd sunday 12:00
1997060112:00:00
22nd sunday at 12:00
1997060112:00:00
22nd sunday at 12:00 EST
1997060112:00:00
22nd sunday in 1996 at 12:00 EST
1996060212:00:00
sunday week 1 1999
1999011000:00:00
thursday week 0 1999
1998123100:00:00
1st thursday in 1999
1999010700:00:00
1st sunday in 1999
1999010300:00:00
1st saturday in 2005
2005010100:00:00
sunday wk 22
1997060100:00:00
sunday week twenty-second 1996
1996060200:00:00
sunday w 22 in 1996
1996060200:00:00
sunday wks 22 12:00
1997060112:00:00
sunday week 22 at 12:00
1997060112:00:00
sunday week 22 at 12:00 EST
1997060112:00:00
sunday week 22 in 1996 at 12:00 EST
1996060212:00:00
sunday 22 wk
1997060100:00:00
sunday twenty-second week 1996
1996060200:00:00
sunday 22 w in 1996
1996060200:00:00
sunday 22 wks 12:00
1997060112:00:00
sunday 22 week at 12:00
1997060112:00:00
sunday 22 week at 12:00 EST
1997060112:00:00
sunday 22 week in 1996 at 12:00 EST
1996060212:00:00
# Tests 'which day in mon' formats
last tue in Jun 96
1996062500:00:00
last tueSday of June
1997062400:00:00
first tue in Jun 1996
1996060400:00:00
1st tue in June
1997060300:00:00
3rd tuesday in Jun 96
1996061800:00:00
3rd tuesday in Jun 96 at 12:00:00.05
1996061812:00:00
3rd tuesday in Jun 96 at 10:30am
1996061810:30:00
3rd tuesday in Jun 96 at 10:30 pm
1996061822:30:00
3rd tuesday in Jun 96 at 10:30 pm GMT
1996061817:30:00
3rd tuesday in Jun 96 at 10:30 pm CET
1996061816:30:00
# Tests YYMMDD time
1996061800:00:00
1996061800:00:00
1996061800:00
1996061800:00:00
96-06-1800:00:00
1996061800:00:00
96-06-1800:00
1996061800:00:00
93-12-01
1993120100:00:00
19931201
1993120100:00:00
93-12-0105:30
1993120105:30:00
1993120105:30
1993120105:30:00
1992022905:30
1992022905:30:00
1990022905:30
nil
1993120105:30:25
1993120105:30:25
1992022905:30:61
nil
1993120105:30:25.05 am
1993120105:30:25
1993120105:30:25:05 pM
1993120117:30:25
1993120105:30:25 pM GMT
1993120112:30:25
19931201 at 05:30:25 pM GMT
1993120112:30:25
19931201at05:30:25 pM GMT
1993120112:30:25
# Tests YYMMDDHHMNSS
19960618000000
1996061800:00:00
# Tests Date Time
# Date%Time
# Date=mm%dd
12/10/1965
1965121000:00:00
12/10/65
1965121000:00:00
12.10.65
1965121000:00:00
12 10 65
1965121000:00:00
12/10/65 5:30:25
1965121005:30:25
12/10/65/5:30 pm
1965121017:30:00
12/10/65/5:30 pm GMT
1965121012:30:00
12/10/65 at 5:30:25
1965121005:30:25
12-10-1965 5:30:25
1965121005:30:25
12-10-65 5:30:25
1965121005:30:25
12-10-65-5:30 pm
1965121017:30:00
12-10-65 at 5:30:25
1965121005:30:25
12 10 65 5:30:25
1965121005:30:25
12 10 65 5:30 pm
1965121017:30:00
12 10 65 at 5:30:25
1965121005:30:25
12 10 1965 at 5:30:25
1965121005:30:25
12.10.1965 05:61
nil
12.10.1965 05:30:61
nil
12/10
$currY 121000:00:00
12/10 05:30
$currY 121005:30:00
12/10 at 05:30:25
$currY 121005:30:25
12/10 at 05:30:25 GMT
$currY 121000:30:25
12/10 5:30
$currY 121005:30:00
12/10 05:30
$currY 121005:30:00
12-10 5:30
$currY 121005:30:00
12.10 05:30
$currY 121005:30:00
12 10 05:30
$currY 121005:30:00
2 29 92
1992022900:00:00
2 29 90
nil
# Tests Date Time
# Date%Time
# Date=mmm%dd
Dec/10/1965
1965121000:00:00
December/10/65
1965121000:00:00
Dec-10-65
1965121000:00:00
Dec 10 65
1965121000:00:00
DecEMBER10 65
1965121000:00:00
December/10/65 5:30:25
1965121005:30:25
Dec/10/65/5:30 pm
1965121017:30:00
Dec/10/65/5:30 pm GMT
1965121012:30:00
Dec/10/65 at 5:30:25
1965121005:30:25
Dec-10-1965 5:30:25
1965121005:30:25
December-10-65 5:30:25
1965121005:30:25
Dec-10-65-5:30 pm
1965121017:30:00
Dec-10-65 at 5:30:25
1965121005:30:25
Dec 10 65 5:30:25
1965121005:30:25
Dec 10 65 5:30 pm
1965121017:30:00
December 10 65 at 5:30:25
1965121005:30:25
Dec 10 1965 at 5:30:25
1965121005:30:25
Dec-10-1965 05:61
nil
Dec-10-1965 05:30:61
nil
December/10
$currY 121000:00:00
Dec/10 05:30
$currY 121005:30:00
Dec/10 at 05:30:25
$currY 121005:30:25
Dec/10 at 05:30:25 GMT
$currY 121000:30:25
Dec/10 5:30
$currY 121005:30:00
Dec/10 05:30
$currY 121005:30:00
Dec-10 5:30
$currY 121005:30:00
Dec-10 05:30
$currY 121005:30:00
December10 05:30
$currY 121005:30:00
DeC first 1965
1965120100:00:00
# Tests Date Time
# Date%Time
# Date=dd%mmm
10/Dec/1965
1965121000:00:00
10/December/65
1965121000:00:00
10-Dec-65
1965121000:00:00
10 Dec 65
1965121000:00:00
10/December/65 5:30:25
1965121005:30:25
10/Dec/65/5:30 pm
1965121017:30:00
10/Dec/65/5:30 pm GMT
1965121012:30:00
10/Dec/65 at 5:30:25
1965121005:30:25
10-Dec-1965 5:30:25
1965121005:30:25
10-December-65 5:30:25
1965121005:30:25
10-Dec-65-5:30 pm
1965121017:30:00
10-Dec-65 at 5:30:25
1965121005:30:25
10 Dec 65 5:30:25
1965121005:30:25
10 Dec 65 5:30 pm
1965121017:30:00
10December 65 at 5:30:25
1965121005:30:25
10 Dec 1965 at 5:30:25
1965121005:30:25
10Dec 1965 at 5:30:25
1965121005:30:25
10 Dec1965 at 5:30:25
1965121005:30:25
10Dec1965 at 5:30:25
1965121005:30:25
10-Dec-1965 05:61
nil
10-Dec-1965 05:30:61
nil
10/December
$currY 121000:00:00
10/Dec 05:30
$currY 121005:30:00
10/Dec at 05:30:25
$currY 121005:30:25
10-Dec at 05:30:25 GMT
$currY 121000:30:25
10-Dec 5:30
$currY 121005:30:00
10/Dec 05:30
$currY 121005:30:00
10December 05:30
$currY 121005:30:00
1st DeC 65
1965120100:00:00
# Tests time only formats
5:30
$todaydate 05:30:00
5:30:02
$todaydate 05:30:02
15:30:00
$todaydate 15:30:00
# Tests TimeDate
# Time%Date
5:30 pm 12/10/65
1965121017:30:00
5:30 pm GMT 12/10/65
1965121012:30:00
5:30:25/12/10/65
1965121005:30:25
5:30:25.05/12/10/65
1965121005:30:25
5:30:25:05/12/10/65
1965121005:30:25
5:30:25 12-10-1965
1965121005:30:25
5:30:25 12-10-65
1965121005:30:25
5:30 pm 12-10-65
1965121017:30:00
5:30:25/12-10-65
1965121005:30:25
5:30:25 12 10 65
1965121005:30:25
5:30 pm 12 10 65
1965121017:30:00
5:30 pm GMT 12 10 65
1965121012:30:00
5:30:25 12 10 1965
1965121005:30:25
05:61 12-10-1965
nil
05:30:61 12-10-1965
nil
05:30 12/10
$currY 121005:30:00
05:30/12/10
$currY 121005:30:00
05:30:25 12/10
$currY 121005:30:25
05:30:25/12-10
$currY 121005:30:25
05:30:25 GMT 12/10
$currY 121000:30:25
5:30 12/10
$currY 121005:30:00
05:30 12/10
$currY 121005:30:00
5:30 12-10
$currY 121005:30:00
05:30 12-10
$currY 121005:30:00
05:30 12 10
$currY 121005:30:00
# Tests TimeDate
# Time%Date
# Date=mmm%dd, dd%mmm
4:50 DeC 10
$currY 121004:50:00
4:50 DeCember 10
$currY 121004:50:00
4:50:40 DeC 10
$currY 121004:50:40
4:50:42 DeCember 10
$currY 121004:50:42
4:50 10 DeC
$currY 121004:50:00
4:50 10 DeCember
$currY 121004:50:00
4:50 10DeC
$currY 121004:50:00
4:50 10DeCember
$currY 121004:50:00
4:50:51 10 DeC
$currY 121004:50:51
4:50:52 10 DeCember
$currY 121004:50:52
4:50:53 10DeC
$currY 121004:50:53
4:50:54 10DeCember
$currY 121004:50:54
4:50:54DeCember10
$currY 121004:50:54
4:50:54DeCember10/65
1965121004:50:54
4:50:54DeCember1965
1965120104:50:54
Sept 1995
1995090100:00:00
1995 september
1995090100:00:00
5:30 DeC 1
$currY 120105:30:00
05:30 DeC 10
$currY 121005:30:00
05:30:11 DeC 10
$currY 121005:30:11
5:30 DeCember 1
$currY 120105:30:00
05:30 DeCember 10
$currY 121005:30:00
05:30:12 DeCember 10
$currY 121005:30:12
# Test ctime formats
DeCember 10 05:30:12 1996
1996121005:30:12
DeC10 05:30:12 96
1996121005:30:12
# Test some tricky timezone conversions
Feb 28 1997 23:00-0900
1997030103:00:00
Feb 27 1997 23:00-0900
1997022803:00:00
Feb 01 1997 01:00-0100
1997013121:00:00
Feb 02 1997 01:00-0100
1997020121:00:00
Feb 02 1997 01:00+0100
1997020119:00:00
Feb 02 1997 01:00+01
1997020119:00:00
Feb 02 1997 01:00+01:00
1997020119:00:00
19970202010000+0100
1997020119:00:00
# More tests...
last day in October 1997
1997103100:00:00
epoch 400000
1970010510:06:40
19980102030405 EST
1998010203:04:05
19980102030405E
1998010117:04:05
Mon, 19 Jan 1998 08:11:34 +1030
1998011816:41:34
Tue, 26 May 1998 13:23:15 -0500 (EST)
1998052613:23:15
Tue, 26 May 1998 13:23:15 -0500 (EST Blah)
1998052613:23:15
Dec101965
1965121000:00:00
10Dec1965
1965121000:00:00
101965Dec
1965121000:00:00
10/dec/1965:12:00:00 EST
1965121012:00:00
2000-02-16 24:00
2000021700:00:00
2000-02-16 15:24:00
2000021615:24:00
2000-02-16T12:30:30
2000021612:30:30
2000-02-16T12:30
2000021612:30:00
99-02-16T12:30
1999021612:30:00
20021216090000 -0500
2002121609:00:00
";
print "Date...\n";
&test_Func($ntest,\&ParseDateString,$dates,$runtests);
1;
DateManip-5.42a/t/date_delta_french.t 0100755 0005100 0000104 00000001410 06736224622 016320 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=4;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Mer Nov 20 1996 12h00
il y a 3 jour 2 heures
1996111510:00:00
Mer Nov 20 1996 12:00
5 heure
1996112108:00:00
Mer Nov 20 1996 12:00
+0:2:0:0
1996112014:00:00
Mer Nov 20 1996 12:00
3 jour 2 h
1996112514:00:00
";
&Date_Init("Language=French","WorkDayBeg=08:00","WorkDayEnd=17h00","EraseHolidays=1");
print "DateCalc (French,date,delta,business 8:00-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/date_date_1.t 0100755 0005100 0000104 00000003677 06515134125 015051 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=25;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Jan 10 1996 noon
Wed Jan 7 1998 noon
+1:11:4:0:0:0:0
Wed Jan 7 1998 noon
Wed Jan 10 1996 noon
-1:11:4:0:0:0:0
Wed Jan 10 1996 noon
Wed Jan 8 1997 noon
+0:11:4:1:0:0:0
Wed Jan 8 1997 noon
Wed Jan 10 1996 noon
-0:11:4:1:0:0:0
Wed May 8 1996 noon
Wed Apr 9 1997 noon
+0:11:0:1:0:0:0
Wed Apr 9 1997 noon
Wed May 8 1996 noon
-0:11:0:1:0:0:0
Wed Apr 10 1996 noon
Wed May 14 1997 noon
+1:1:0:4:0:0:0
Wed May 14 1997 noon
Wed Apr 10 1996 noon
-1:1:0:4:0:0:0
Wed Jan 10 1996 noon
Wed Feb 7 1996 noon
+0:0:4:0:0:0:0
Wed Feb 7 1996 noon
Wed Jan 10 1996 noon
-0:0:4:0:0:0:0
Mon Jan 8 1996 noon
Fri Feb 9 1996 noon
+0:1:0:1:0:0:0
Fri Feb 9 1996 noon
Mon Jan 8 1996 noon
-0:1:0:1:0:0:0
Jan 1 1996 12:00:00
Jan 1 1996 14:30:30
+0:0:0:0:2:30:30
Jan 1 1996 14:30:30
Jan 1 1996 12:00:00
-0:0:0:0:2:30:30
Jan 1 1996 12:00:00
Jan 2 1996 14:30:30
+0:0:0:1:2:30:30
Jan 2 1996 14:30:30
Jan 1 1996 12:00:00
-0:0:0:1:2:30:30
Jan 1 1996 12:00:00
Jan 2 1996 10:30:30
+0:0:0:0:22:30:30
Jan 2 1996 10:30:30
Jan 1 1996 12:00:00
-0:0:0:0:22:30:30
Jan 1 1996 12:00:00
Jan 2 1997 10:30:30
+1:0:0:0:22:30:30
Jan 2 1997 10:30:30
Jan 1 1996 12:00:00
-1:0:0:0:22:30:30
Jan 31 1996 12:00:00
Feb 28 1997 10:30:30
+1:0:3:6:22:30:30
Feb 28 1997 10:30:30
Jan 31 1996 12:00:00
-1:0:3:6:22:30:30
Jan 1st 1997 00:00:01
Feb 1st 1997 00:00:00
+0:0:4:2:23:59:59
Jan 1st 1997 00:00:01
Mar 1st 1997 00:00:00
+0:1:3:6:23:59:59
Jan 1st 1997 00:00:01
Mar 1st 1998 00:00:00
+1:1:3:6:23:59:59
";
print "DateCalc (date,date,approx)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,1);
1;
DateManip-5.42a/t/date_date_2a.t 0100755 0005100 0000104 00000003655 06736222046 015214 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=23;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Jun 1 1999
Jun 4 1999
+0:0:0:2:0:0:0
Wed Jan 10 1996 noon
Wed Jan 7 1998 noon
+1:11:0:18:0:0:0
Wed Jan 7 1998 noon
Wed Jan 10 1996 noon
-1:11:0:18:0:0:0
Wed Jan 10 1996 noon
Wed Jan 8 1997 noon
+0:11:0:19:0:0:0
Wed Jan 8 1997 noon
Wed Jan 10 1996 noon
-0:11:0:19:0:0:0
Wed May 8 1996 noon
Wed Apr 9 1997 noon
+0:11:0:1:0:0:0
Wed Apr 9 1997 noon
Wed May 8 1996 noon
-0:11:0:1:0:0:0
Wed Apr 10 1996 noon
Wed May 14 1997 noon
+1:1:0:2:4:0:0
Wed May 14 1997 noon
Wed Apr 10 1996 noon
-1:1:0:2:4:0:0
Wed Jan 10 1996 noon
Wed Feb 7 1996 noon
+0:0:0:19:0:0:0
Wed Feb 7 1996 noon
Wed Jan 10 1996 noon
-0:0:0:19:0:0:0
Mon Jan 8 1996 noon
Fri Feb 9 1996 noon
+0:1:0:1:0:0:0
Fri Feb 9 1996 noon
Mon Jan 8 1996 noon
-0:1:0:1:0:0:0
Tue Jan 9 1996 12:00:00
Tue Jan 9 1996 14:30:30
+0:0:0:0:2:30:30
Tue Jan 9 1996 14:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:0:2:30:30
Tue Jan 9 1996 12:00:00
Wed Jan 10 1996 14:30:30
+0:0:0:1:2:30:30
Wed Jan 10 1996 14:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:1:2:30:30
Tue Jan 9 1996 12:00:00
Wed Jan 10 1996 10:30:30
+0:0:0:0:7:30:30
Wed Jan 10 1996 10:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:0:7:30:30
Tue Jan 9 1996 12:00:00
Fri Jan 10 1997 10:30:30
+1:0:0:0:7:30:30
Fri Jan 10 1997 10:30:30
Tue Jan 9 1996 12:00:00
-1:0:0:0:7:30:30
Mon Dec 30 1996 noon
Mon Jan 6 1997 noon
+0:0:0:4:0:0:0
Mon Jan 6 1997 noon
Mon Dec 30 1996 noon
-0:0:0:4:0:0:0
";
&Date_Init("WorkDayBeg=8:00","WorkDayEnd=17:00");
print "DateCalc (date,date,business 8:00-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/date_date_2b.t 0100755 0005100 0000104 00000002227 06617377617 015224 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=10;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Jan 10 1996 noon
Wed Feb 7 1996 noon
+0:0:0:19:0:0:0
Wed Feb 7 1996 noon
Wed Jan 10 1996 noon
-0:0:0:19:0:0:0
Tue Jan 9 1996 12:00:00
Tue Jan 9 1996 14:30:30
+0:0:0:0:2:30:30
Tue Jan 9 1996 14:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:0:2:30:30
Tue Jan 9 1996 12:00:00
Wed Jan 10 1996 14:30:30
+0:0:0:1:2:30:30
Wed Jan 10 1996 14:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:1:2:30:30
Tue Jan 9 1996 12:00:00
Wed Jan 10 1996 10:30:30
+0:0:0:0:7:30:30
Wed Jan 10 1996 10:30:30
Tue Jan 9 1996 12:00:00
-0:0:0:0:7:30:30
Mon Dec 30 1996 noon
Mon Jan 6 1997 noon
+0:0:0:4:0:0:0
Mon Jan 6 1997 noon
Mon Dec 30 1996 noon
-0:0:0:4:0:0:0
";
&Date_Init("WorkDayBeg=8:00","WorkDayEnd=17:00");
print "DateCalc (date,date,business 8:00-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,3);
1;
DateManip-5.42a/t/date_delta_0.t 0100755 0005100 0000104 00000001600 06515134134 015204 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=9;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Feb 7 1996 8:00
+1:1:1:1
1996020809:01:01
Wed Nov 20 1996 noon
+0:5:0:0
1996112017:00:00
Wed Nov 20 1996 noon
+0:13:0:0
1996112101:00:00
Wed Nov 20 1996 noon
+3:2:0:0
1996112314:00:00
Wed Nov 20 1996 noon
-3:2:0:0
1996111710:00:00
Wed Nov 20 1996 noon
+3:13:0:0
1996112401:00:00
Wed Nov 20 1996 noon
+6:2:0:0
1996112614:00:00
Dec 31 1996 noon
+1:2:0:0
1997010114:00:00
Jan 31 1997 23:59:59
+ 1 sec
1997020100:00:00
";
print "DateCalc (date,delta,exact)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,0);
1;
DateManip-5.42a/t/date_delta_1.t 0100755 0005100 0000104 00000001601 06515134141 015204 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=9;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Feb 7 1996 8:00
+1:1:1:1
1996020809:01:01
Wed Nov 20 1996 noon
+0:5:0:0
1996112017:00:00
Wed Nov 20 1996 noon
+0:13:0:0
1996112101:00:00
Wed Nov 20 1996 noon
+3:2:0:0
1996112314:00:00
Wed Nov 20 1996 noon
-3:2:0:0
1996111710:00:00
Wed Nov 20 1996 noon
+3:13:0:0
1996112401:00:00
Wed Nov 20 1996 noon
+6:2:0:0
1996112614:00:00
Dec 31 1996 noon
+1:2:0:0
1997010114:00:00
Jan 31 1997 23:59:59
+ 1 sec
1997020100:00:00
";
print "DateCalc (date,delta,approx)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,1);
1;
DateManip-5.42a/t/date_delta_2a.t 0100755 0005100 0000104 00000003404 07600146757 015365 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=24;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Nov 20 1996 noon
+0:5:0:0
1996112108:00:00
Wed Nov 20 1996 noon
+0:2:0:0
1996112014:00:00
Wed Nov 20 1996 noon
+3:2:0:0
1996112514:00:00
Wed Nov 20 1996 noon
-3:2:0:0
1996111510:00:00
Wed Nov 20 1996 noon
+3:7:0:0
1996112610:00:00
Wed Nov 20 1996 noon
+6:2:0:0
1996112914:00:00
Dec 31 1996 noon
+1:2:0:0
1997010214:00:00
Dec 30 1996 noon
+1:2:0:0
1996123114:00:00
Mar 31 1997 16:59:59
+ 1 sec
1997040108:00:00
Wed Nov 20 1996 noon
+0:0:1:0:0:0:0
1996112712:00:00
2002120600:00:00
- business 4 hours
2002120513:00:00
2002120600:00:01
- business 4 hours
2002120513:00:00
2002120523:59:59
- business 4 hours
2002120513:00:00
2002120602:00:00
- business 4 hours
2002120513:00:00
2002120609:00:00
- business 4 hours
2002120514:00:00
2002120609:00:10
- business 4 hours
2002120514:00:10
2002120611:00:00
- business 4 hours
2002120516:00:00
2002120612:00:00
- business 4 hours
2002120608:00:00
2002120512:00:00
+ business 4 hours
2002120516:00:00
2002120514:00:00
+ business 4 hours
2002120609:00:00
2002120522:00:00
+ business 4 hours
2002120612:00:00
2002120523:59:59
+ business 4 hours
2002120612:00:00
2002120602:00:00
+ business 4 hours
2002120612:00:00
2002120609:00:00
+ business 4 hours
2002120613:00:00
";
&Date_Init("WorkDayBeg=08:00","WorkDayEnd=17:00");
print "DateCalc (date,delta,business 8:00-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/date_delta_2b.t 0100755 0005100 0000104 00000001227 06515134151 015354 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=3;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Wed Nov 20 1996 noon
+0:5:0:0
1996112108:30:00
Wed Nov 20 1996 noon
+3:7:0:0
1996112610:30:00
Mar 31 1997 16:59:59
+ 1 sec
1997040108:30:00
";
&Date_Init("WorkDayBeg=08:30","WorkDayEnd=17:00");
print "DateCalc (date,delta,business 8:30-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/delta_delta_2a.t 0100755 0005100 0000104 00000001055 06515134212 015524 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=1;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
+1:6:30:30
+1:3:45:45
+0:0:0:3:1:16:15
";
&Date_Init("WorkDayBeg=08:00","WorkDayEnd=17:00");
print "DateCalc (delta,delta,business 8:00-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/date_french.t 0100755 0005100 0000104 00000010732 06647134620 015155 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=89;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"ForceDate=1997-03-08-12:30:00");
($currS,$currMN,$currH,$currD,$currM,$currY)=("00","30","12","08","03","1997");
$today="$currY$currM$currD$currH:$currMN:$currS";
#$todaydate="$currY$currM$currD";
$yesterday="$currY$currM". $currD-1 ."$currH:$currMN:$currS";
$tomorrow ="$currY$currM". $currD+1 ."$currH:$currMN:$currS";
$dates="
aujourd'hui
>Ignore failure on a slow computer.
~$today
maintenant
>Ignore failure on a slow computer.
~$today
hier
>Ignore failure on a slow computer or on the 1st day of the month.
~$yesterday
demain
>Ignore failure on a slow computer or on the last day of the month.
~$tomorrow
dernier mar en Juin 96
1996062500:00:00
dernier mar de Juin
1997062400:00:00
premier mar de Juin 1996
1996060400:00:00
premier mar de Juin
1997060300:00:00
3e mardi de Juin 96
1996061800:00:00
3e mardi de Juin 96 a 12:00
1996061812:00:00
3e mardi de Juin 96 a 10:30 du matin
1996061810:30:00
3e mardi de Juin 96 a 10:30 du soir
1996061822:30:00
DeC 10 65
1965121000:00:00
DeC 10 1965
1965121000:00:00
Decembre 10 65
1965121000:00:00
Decembre 10 1965
1965121000:00:00
Decembre10 1965
1965121000:00:00
Decembre10 1965 12:00
1965121012:00:00
Decembre-10-1965 12:00
1965121012:00:00
Decembre/10/1965/12:00
1965121012:00:00
Decembre/10/12:00
1997121012:00:00
12:00Decembre10 1965
1965121012:00:00
12:00 Decembre10 1965
1965121012:00:00
12:00-Decembre-10-1965
1965121012:00:00
12:00 Decembre-10-1965
1965121012:00:00
10 DeC 65
1965121000:00:00
10 DeC 1965
1965121000:00:00
10 Decembre 65
1965121000:00:00
10 Decembre 1965
1965121000:00:00
10DeC65
1965121000:00:00
10DeC1965
1965121000:00:00
10Decembre65
1965121000:00:00
10Decembre 1965
1965121000:00:00
DeC 10 4:50
$currY 121004:50:00
Decembre 10 4:50
$currY 121004:50:00
DeC 10 4:50:40
$currY 121004:50:40
Decembre 10 4:50:42
$currY 121004:50:42
10 DeC 4:50
$currY 121004:50:00
10 Decembre 4:50
$currY 121004:50:00
10DeC 4:50
$currY 121004:50:00
10Decembre 4:50
$currY 121004:50:00
10 DeC 4:50:51
$currY 121004:50:51
10 Decembre 4:50:52
$currY 121004:50:52
10DeC 4:50:53
$currY 121004:50:53
10Decembre 4:50:54
$currY 121004:50:54
10Decembre95 4:50:54
1995121004:50:54
Dec10/65 4:50:53
1965121004:50:53
Dec101965 4:50:53
1965121004:50:53
4:50 DeC 10
$currY 121004:50:00
4:50 Decembre 10
$currY 121004:50:00
4:50:40 DeC 10
$currY 121004:50:40
4:50:42 Decembre 10
$currY 121004:50:42
4:50 10 DeC
$currY 121004:50:00
4:50 10 Decembre
$currY 121004:50:00
4:50 10DeC
$currY 121004:50:00
4:50 10Decembre
$currY 121004:50:00
4:50:51 10 DeC
$currY 121004:50:51
4:50:52 10 Decembre
$currY 121004:50:52
4:50:53 10DeC
$currY 121004:50:53
4:50:54 10Decembre
$currY 121004:50:54
4:50:54Decembre10
$currY 121004:50:54
4:50:54Decembre10/65
1965121004:50:54
DeC 1 5:30
$currY 120105:30:00
DeC 10 05:30
$currY 121005:30:00
DeC 10 05:30:11
$currY 121005:30:11
DeC 1 65
1965120100:00:00
DeC 1 1965
1965120100:00:00
Decembre 1 5:30
$currY 120105:30:00
Decembre 10 05:30
$currY 121005:30:00
Decembre 10 05h30:12
$currY 121005:30:12
Decembre 1 65
1965120100:00:00
Decembre 1 1965
1965120100:00:00
5:30 DeC 1
$currY 120105:30:00
05:30 DeC 10
$currY 121005:30:00
05:30:11 DeC 10
$currY 121005:30:11
5:30 Decembre 1
$currY 120105:30:00
05:30 Decembre 10
$currY 121005:30:00
05:30:12 du matin Decembre 10
$currY 121005:30:12
05:30:12 du soir Decembre 10
$currY 121017:30:12
1 DeC 65
1965120100:00:00
1 DeC 1965
1965120100:00:00
1 Decembre 65
1965120100:00:00
1 Decembre 1965
1965120100:00:00
12 1 65
1965120100:00:00
12 1 1965
1965120100:00:00
2 29 92
1992022900:00:00
2 29 90
nil
1er DeC 65
1965120100:00:00
DeC premier 1965
1965120100:00:00
";
print "Date (French)...\n";
&Date_Init("Language=French","DateFormat=US","Internal=0");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/date_german.t 0100755 0005100 0000104 00000001060 06566061404 015152 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=1;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"ForceDate=1997-03-08-12:30:00");
$dates="
08.04.1999
1999080400:00:00
";
print "Date (German)...\n";
&Date_Init("Language=German","DateFormat=US","Internal=0");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/date_misc_a.t 0100755 0005100 0000104 00000001111 06515134164 015127 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=2;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$dates="
# Tests YYMMDD time
1996061800:00:00
19960618000000
# Tests YYMMDDHHMNSS
19960618000000
19960618000000
";
print "Date (English,Internal=1)...\n";
&Date_Init("Internal=1");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/date_misc_b.t 0100755 0005100 0000104 00000001122 06515134170 015127 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=2;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$dates="
# Tests YYMMDD time
1996061800:00:00
1996-06-18_00:00:00
# Tests YYMMDDHHMNSS
19960618000000
1996-06-18_00:00:00
";
print "Date (English,Internal=2)...\n";
&Date_Init("Internal=2");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/date_romanian.t 0100755 0005100 0000104 00000023270 07052241574 015513 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=196;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"ForceDate=1997-03-08-12:30:00");
($currS,$currMN,$currH,$currD,$currM,$currY)=("00","30","12","08","03","1997");
$today="$currY$currM$currD$currH:$currMN:$currS";
$todaydate ="$currY$currM$currD";
$yesterdaydate="$currY$currM". $currD-1;
$tomorrowdate ="$currY$currM". $currD+1;
$yesterday ="$yesterdaydate$currH:$currMN:$currS";
$tomorrow ="$tomorrowdate$currH:$currMN:$currS";
$dates="
# Test built in strings like today and yesterday. A few may fail on a
# slow computer. On the 1st or last day of the month, the yesterday/today
# test will fail because of the simplicity of the test.
acum
>Ignore failure on a slow computer.
~$today
astazi
>Ignore failure on a slow computer.
~$today
ieri
>Ignore failure on a slow computer or on the 1st day of the month.
~$yesterday
miine
>Ignore failure on a slow computer or on the last day of the month.
~$tomorrow
astazi la 4:00
$todaydate 04:00:00
astazi la 4:00 pm
$todaydate 16:00:00
astazi la 16:00:00
$todaydate 16:00:00
astazi la 12:00 am
$todaydate 00:00:00
astazi la 12:00 GMT
$todaydate 07:00:00
astazi la 4:00 PST
$todaydate 07:00:00
astazi la 4:00 -0800
$todaydate 07:00:00
astazi la amiaza
$todaydate 12:00:00
miine la amiaza
>Ignore failure on a slow computer or on the last day of the month.
$tomorrowdate 12:00:00
1 luna in urma
1997020812:30:00
# Test weeks
a 22-a duminica
1997060100:00:00
1997023
1997012300:00:00
1997035
1997020400:00:00
97-035
1997020400:00:00
97035
1997020400:00:00
a douazecisidoua duminica 1996
1996060200:00:00
22 duminica in 1996
1996060200:00:00
a 22-a duminica 12:00
1997060112:00:00
a 22-a duminica la 12:00
1997060112:00:00
a 22-a duminica la 12:00 EST
1997060112:00:00
a 22-a duminica in 1996 la 12:00 EST
1996060212:00:00
duminica saptamina 1 1999
1999011000:00:00
joi saptamina 0 1999
1998123100:00:00
prima joi in 1999
1999010700:00:00
prima duminica in 1999
1999010300:00:00
duminica saptamina 22
1997060100:00:00
duminica saptamina a douazecisidoua 1996
1996060200:00:00
duminica sapt 22 in 1996
1996060200:00:00
duminica saptamina 22 12:00
1997060112:00:00
duminica saptamina 22 12:00
1997060112:00:00
duminica saptamina 22 la 12:00 EST
1997060112:00:00
duminica saptamina 22 in 1996 la 12:00 EST
1996060212:00:00
duminica 22 saptamini
1997060100:00:00
duminica a douazecisidoua saptamina 1996
1996060200:00:00
duminica 22 sapt in 1996
1996060200:00:00
duminica saptamina 22 12:00
1997060112:00:00
duminica saptamina 22 la 12:00
1997060112:00:00
duminica saptamina 22 la 12:00 EST
1997060112:00:00
duminica saptamina 22 in 1996 la 12:00 EST
1996060212:00:00
# Tests 'which day in mon' formats
ultima marti in iun 96
1996062500:00:00
ultima marti din iunie
1997062400:00:00
prima marti in iun 1996
1996060400:00:00
prima marti in iunie
1997060300:00:00
a 3-a marti in iun 96
1996061800:00:00
a 3-a marti in iun 96 la 12:00:00
1996061812:00:00
a 3-a marti in iun 96 la 10:30am
1996061810:30:00
a 3-a marti in iun 96 la 10:30 pm
1996061822:30:00
a 3-a marti in iun 96 la 10:30 pm GMT
1996061817:30:00
a 3-a marti in iun 96 la 10:30 pm CET
1996061816:30:00
# Tests Date Time
# Date%Time
# Date=mm%dd
12/10/65 la 5:30:25
1965121005:30:25
12-10-65 la 5:30:25
1965121005:30:25
12 10 65 la 5:30:25
1965121005:30:25
12 10 1965 la 5:30:25
1965121005:30:25
12.10.1965 05:61
nil
12.10.1965 05:30:61
nil
12/10
$currY 121000:00:00
12/10 05:30
$currY 121005:30:00
12/10 la 05:30:25
$currY 121005:30:25
12/10 la 05:30:25 GMT
$currY 121000:30:25
12/10 5:30
$currY 121005:30:00
12/10 05:30
$currY 121005:30:00
12-10 5:30
$currY 121005:30:00
12.10 05:30
$currY 121005:30:00
12 10 05:30
$currY 121005:30:00
2 29 92
1992022900:00:00
2 29 90
nil
# Tests Date Time
# Date%Time
# Date=mmm%dd
Dec/10/1965
1965121000:00:00
Decembrie/10/65
1965121000:00:00
Dec-10-65
1965121000:00:00
Dec 10 65
1965121000:00:00
DecEMBRIE10 65
1965121000:00:00
Decembrie/10/65 5:30:25
1965121005:30:25
Dec/10/65/5:30 pm
1965121017:30:00
Dec/10/65/5:30 pm GMT
1965121012:30:00
Dec/10/65 la 5:30:25
1965121005:30:25
Dec-10-1965 5:30:25
1965121005:30:25
Decembrie-10-65 5:30:25
1965121005:30:25
Dec-10-65-5:30 pm
1965121017:30:00
Dec-10-65 la 5:30:25
1965121005:30:25
Dec 10 65 5:30:25
1965121005:30:25
Dec 10 65 5:30 pm
1965121017:30:00
Decembrie 10 65 la 5:30:25
1965121005:30:25
Dec 10 1965 la 5:30:25
1965121005:30:25
Dec-10-1965 05:61
nil
Dec-10-1965 05:30:61
nil
Decembrie/10
$currY 121000:00:00
Dec/10 05:30
$currY 121005:30:00
Dec/10 la 05:30:25
$currY 121005:30:25
Dec/10 la 05:30:25 GMT
$currY 121000:30:25
Dec/10 5:30
$currY 121005:30:00
Dec/10 05:30
$currY 121005:30:00
Dec-10 5:30
$currY 121005:30:00
Dec-10 05:30
$currY 121005:30:00
Decembrie10 05:30
$currY 121005:30:00
DeC intii 1965
1965120100:00:00
# Tests Date Time
# Date%Time
# Date=dd%mmm
10/Dec/1965
1965121000:00:00
10/Decembrie/65
1965121000:00:00
10-Dec-65
1965121000:00:00
10 Dec 65
1965121000:00:00
10/Decembrie/65 5:30:25
1965121005:30:25
10/Dec/65/5:30 pm
1965121017:30:00
10/Dec/65/5:30 pm GMT
1965121012:30:00
10/Dec/65 la 5:30:25
1965121005:30:25
10-Dec-1965 5:30:25
1965121005:30:25
10-Decembrie-65 5:30:25
1965121005:30:25
10-Dec-65-5:30 pm
1965121017:30:00
10-Dec-65 la 5:30:25
1965121005:30:25
10 Dec 65 5:30:25
1965121005:30:25
10 Dec 65 5:30 pm
1965121017:30:00
10Decembrie 65 la 5:30:25
1965121005:30:25
10 Dec 1965 la 5:30:25
1965121005:30:25
10Dec 1965 la 5:30:25
1965121005:30:25
10 Dec1965 la 5:30:25
1965121005:30:25
10Dec1965 la 5:30:25
1965121005:30:25
10-Dec-1965 05:61
nil
10-Dec-1965 05:30:61
nil
10/Decembrie
$currY 121000:00:00
10/Dec 05:30
$currY 121005:30:00
10/Dec la 05:30:25
$currY 121005:30:25
10-Dec la 05:30:25 GMT
$currY 121000:30:25
10-Dec 5:30
$currY 121005:30:00
10/Dec 05:30
$currY 121005:30:00
10Decembrie 05:30
$currY 121005:30:00
Intii DeC 65
1965120100:00:00
# Tests time only formats
5:30
$todaydate 05:30:00
5:30:02
$todaydate 05:30:02
15:30:00
$todaydate 15:30:00
# Tests TimeDate
# Time%Date
5:30 pm 12/10/65
1965121017:30:00
5:30 pm GMT 12/10/65
1965121012:30:00
5:30:25/12/10/65
1965121005:30:25
5:30:25 12-10-1965
1965121005:30:25
5:30:25 12-10-65
1965121005:30:25
5:30 pm 12-10-65
1965121017:30:00
5:30:25/12-10-65
1965121005:30:25
5:30:25 12 10 65
1965121005:30:25
5:30 pm 12 10 65
1965121017:30:00
5:30 pm GMT 12 10 65
1965121012:30:00
5:30:25 12 10 1965
1965121005:30:25
05:61 12-10-1965
nil
05:30:61 12-10-1965
nil
05:30 12/10
$currY 121005:30:00
05:30/12/10
$currY 121005:30:00
05:30:25 12/10
$currY 121005:30:25
05:30:25/12-10
$currY 121005:30:25
05:30:25 GMT 12/10
$currY 121000:30:25
5:30 12/10
$currY 121005:30:00
05:30 12/10
$currY 121005:30:00
5:30 12-10
$currY 121005:30:00
05:30 12-10
$currY 121005:30:00
05:30 12 10
$currY 121005:30:00
# Tests TimeDate
# Time%Date
# Date=mmm%dd, dd%mmm
4:50 DeC 10
$currY 121004:50:00
4:50 DeCembrie 10
$currY 121004:50:00
4:50:40 DeC 10
$currY 121004:50:40
4:50:42 DeCembrie 10
$currY 121004:50:42
4:50 10 DeC
$currY 121004:50:00
4:50 10 DeCembrie
$currY 121004:50:00
4:50 10DeC
$currY 121004:50:00
4:50 10DeCembrie
$currY 121004:50:00
4:50:51 10 DeC
$currY 121004:50:51
4:50:52 10 DeCembrie
$currY 121004:50:52
4:50:53 10DeC
$currY 121004:50:53
4:50:54 10DeCembrie
$currY 121004:50:54
4:50:54DeCembrie10
$currY 121004:50:54
4:50:54DeCembrie10/65
1965121004:50:54
4:50:54DeCembrie1965
1965120104:50:54
Sept 1995
1995090100:00:00
1995 septembrie
1995090100:00:00
5:30 DeC 1
$currY 120105:30:00
05:30 DeC 10
$currY 121005:30:00
05:30:11 DeC 10
$currY 121005:30:11
5:30 DeCembrie 1
$currY 120105:30:00
05:30 DeCembrie 10
$currY 121005:30:00
05:30:12 DeCembrie 10
$currY 121005:30:12
# Test ctime formats
DeCembrie 10 05:30:12 1996
1996121005:30:12
DeC10 05:30:12 96
1996121005:30:12
# Test some tricky timezone conversions
Febr 28 1997 23:00-0900
1997030103:00:00
Febr 27 1997 23:00-0900
1997022803:00:00
Febr 01 1997 01:00-0100
1997013121:00:00
Febr 02 1997 01:00-0100
1997020121:00:00
Febr 02 1997 01:00+0100
1997020119:00:00
Febr 02 1997 01:00+01
1997020119:00:00
Febr 02 1997 01:00+01:00
1997020119:00:00
19970202010000+0100
1997020119:00:00
# More tests...
ultima zi din octombrie 1997
1997103100:00:00
epoch 400000
1970010510:06:40
19980102030405 EST
1998010203:04:05
19980102030405E
1998010117:04:05
Luni, 19 ian 1998 08:11:34 +1030
1998011816:41:34
Marti, 26 Mai 1998 13:23:15 -0500 (EST)
1998052613:23:15
Dec101965
1965121000:00:00
10Dec1965
1965121000:00:00
101965Dec
1965121000:00:00
";
print "Date (Romanian)...\n";
&Date_Init("Language=Romanian","DateFormat=US","Internal=0");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/delta_a.t 0100755 0005100 0000104 00000003033 06515134174 014276 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=30;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$deltas="
# Test weeks
+ 4 week 3 day
+0:0:4:3:0:0:0
+ 4 wk 3 day 20:30
+0:0:4:3:0:20:30
+ 15mn
+0:0:0:0:0:15:0
+ 15 mn
+0:0:0:0:0:15:0
15 mn
+0:0:0:0:0:15:0
+15 mn
+0:0:0:0:0:15:0
+15mn
+0:0:0:0:0:15:0
+ 35 y 10 month 15mn
+35:10:0:0:0:15:0
+ 35 y 10m15mn
+35:10:0:0:0:15:0
+ 35year 10:0:0:0:15:0
+35:10:0:0:0:15:0
+ 35 y -10 month 15mn
+34:2:-0:0:0:15:0
+35:-10:0:0:0:15:0
+34:2:-0:0:0:15:0
+ 35 y10 month12:40
+35:10:0:0:0:12:40
+35 y 10 month 1:12:40
+35:10:0:0:1:12:40
+35x 10 month
nil
+ 35 y -10 month 1:12:40
+34:2:-0:0:1:12:40
1:2:3:4:5:6:7
+1:2:3:4:5:6:7
in 1:2:3:4:5:6:7
+1:2:3:4:5:6:7
1:2:3:4:5:6:7 ago
-1:2:3:4:5:6:7
-1:2:3:4:5:6:7
-1:2:3:4:5:6:7
1::3:4:5:6:7ago
-1:0:3:4:5:6:7
# Test normalization of deltas
+1:+1:+1:+1
+0:0:0:1:1:1:1
+1:+1:+1:-1
+0:0:0:1:1:0:59
+1:+1:-1:+1
+0:0:0:1:0:59:1
+1:-1:+1:+1
+0:0:0:0:23:1:1
+1:+1:-1:-1
+0:0:0:1:0:58:59
+1:-1:+1:-1
+0:0:0:0:23:0:59
+1:-1:-1:+1
+0:0:0:0:22:59:1
-0:1:+0:0:0:0:0
-0:1:0:0:0:0:0
-0:0:1:+0:-0:0:0
-0:0:1:0:0:0:0
";
print "Delta...\n";
&test_Func($ntest,\&ParseDateDelta,$deltas,$runtests);
1;
DateManip-5.42a/t/delta_b.t 0100755 0005100 0000104 00000001104 06515134200 014262 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=4;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"DeltaSigns=1");
$deltas="
1:2:3:4:5:6:7
+1:+2:+3:+4:+5:+6:+7
-1:2:3:4:5:6:7
-1:-2:-3:-4:-5:-6:-7
35x
nil
+0
+0:+0:+0:+0:+0:+0:+0
";
print "Delta (signs)...\n";
&test_Func($ntest,\&ParseDateDelta,$deltas,$runtests);
1;
DateManip-5.42a/t/delta_delta_0.t 0100755 0005100 0000104 00000001274 06515134203 015364 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=6;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
1:1:1:1
2:2:2:2
+0:0:0:3:3:3:3
1:1:1:1
2:-1:1:1
+0:0:0:3:0:0:0
1:1:1:1
0:-11:5:6
+0:0:0:0:13:55:55
1:1:1:1
0:-25:5:6
-0:0:0:0:0:4:5
1:1:0:1:1:1:1
2:12:1:2:48:120:120
+4:1:1:5:3:3:1
1:1:0:1:1:1:1
2:12:0:-2:48:120:120
+4:1:-0:3:1:0:59
";
print "DateCalc (delta,delta,exact)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,0);
1;
DateManip-5.42a/t/events.t 0100755 0005100 0000104 00000002402 07057756712 014222 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=8;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests ="
2000-02-01
~
[
2000020100:00:00
[ Winter Event1 ]
]
2000-04-01
~
[
2000040100:00:00
[ Spring ]
]
2000-04-01
0
~
[
2000040100:00:00
[ Spring ]
2000040112:00:00
[ Spring Event3 ]
2000040113:00:00
[ Spring ]
]
2000-04-01 12:30
~
[
2000040112:30:00
[ Spring Event3 ]
]
2000-04-01 13:30
~
[
2000040113:30:00
[ Spring ]
]
2000-03-15
2000-04-10
~
[
2000031500:00:00
[ Winter ]
2000032200:00:00
[ Spring ]
2000040112:00:00
[ Spring Event3 ]
2000040113:00:00
[ Spring ]
]
2000-03-15
2000-04-10
1
~
{
Event3 => +0:0:0:0:1:0:0
Spring => +0:0:2:5:0:0:0
Winter => +0:0:1:0:0:0:0
}
2000-03-15
2000-04-10
2
~
{
Event3+Spring => +0:0:0:0:1:0:0
Spring => +0:0:2:4:23:0:0
Winter => +0:0:1:0:0:0:0
}
";
print "Event_List...\n";
&test_Func($ntest,\&Events_List,$tests,$runtests);
1;
DateManip-5.42a/t/delta_delta_1.t 0100755 0005100 0000104 00000001275 06515134206 015371 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=6;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
1:1:1:1
2:2:2:2
+0:0:0:3:3:3:3
1:1:1:1
2:-1:1:1
+0:0:0:3:0:0:0
1:1:1:1
0:-11:5:6
+0:0:0:0:13:55:55
1:1:1:1
0:-25:5:6
-0:0:0:0:0:4:5
1:1:1:1:1:1:1
2:12:5:2:48:120:120
+4:1:6:5:3:3:1
1:1:1:1:1:1:1
2:12:-1:2:48:120:120
+4:1:-0:3:1:0:59
";
print "DateCalc (delta,delta,approx)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,1);
1;
DateManip-5.42a/t/delta_delta_2b.t 0100755 0005100 0000104 00000001055 06515134216 015531 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=1;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
+1:6:30:30
+1:3:45:45
+0:0:0:3:1:46:15
";
&Date_Init("WorkDayBeg=08:30","WorkDayEnd=17:00");
print "DateCalc (delta,delta,business 8:30-5:00)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/delta_format.t 0100755 0005100 0000104 00000001547 07600157076 015360 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=5;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests="
0:0:1:2:3:4:5
4
%wv %dv %hv %mv %sv : %wh %dh %hh %mh %sh
1_2_3_4_5_:_1_9_219_13144_788645
0:0:1:2:3:4:5
4
%wd %dd %hd %md %sd
1.3040_2.1278_3.0681_4.0833_5.0000
0:0:1:2:3:4:5
4
%wt %dt %ht %mt %st
1.3040_9.1278_219.0681_13144.0833_788645.0000
1:6:1:2:3:4:5
4
%yd %Md %wd %dd %hd %md %sd
1.5000_6.0000_1.3040_2.1278_3.0681_4.0833_5.0000
1:0:1:2:3:4:5
4
%yd %wd %dd %hd %md %sd
1.0250_1.3040_2.1278_3.0681_4.0833_5.0000
";
print "FormatDelta...\n";
&test_Func($ntest,\&Delta_Format,$tests,$runtests);
1;
DateManip-5.42a/t/delta_romanian.t 0100755 0005100 0000104 00000003055 06711074275 015671 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=21;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
Mie Febr 7 1996 8:00
+1:1:1:1
1996020809:01:01
Mie Nov 20 1996 amiaza
+0:5:0:0
1996112017:00:00
Mie Nov 20 1996 amiaza
+0:13:0:0
1996112101:00:00
Mie Nov 20 1996 amiaza
+3:2:0:0
1996112314:00:00
Mie Nov 20 1996 amiaza
-3:2:0:0
1996111710:00:00
Mie Nov 20 1996 amiaza
+3:13:0:0
1996112401:00:00
Mie Nov 20 1996 amiaza
+6:2:0:0
1996112614:00:00
Dec 31 1996 amiaza
+1:2:0:0
1997010114:00:00
Ian 31 1997 23:59:59
+ 1 sec
1997020100:00:00
Mie Feb 7 1996 8:00
+1:1:1:1
1996020809:01:01
Mie Nov 20 1996 amiaza
+0:2:0:0
1996112014:00:00
Mie Nov 20 1996 amiaza
+3:7:0:0
1996112319:00:00
Dec 30 1996 amiaza
+1:2:0:0
1996123114:00:00
Mart 31 1997 23:59:59
+ 1 sec
1997040100:00:00
Mie Nov 20 1996 amiaza
+0:0:1:0:0:0:0
1996112712:00:00
Mie Nov 20 1996 19:00
5 ore
1996112100:00:00
Mie Nov 20 1996 12:00
+0:2:0:0
1996112014:00:00
Mie Nov 20 1996 12:00
3 zile 2 h
1996112314:00:00
Mie Nov 20 1996 12:00
in urma 3 zile 2 ore
1996111710:00:00
Mie Nov 20 1996 12:00
5 ore
1996112017:00:00
Mie Nov 20 1996 12:00
3 zile 2 h
1996112314:00:00
";
&Date_Init("Language=Romanian");
print "DateCalc (Romanian,delta)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,0);
1;
DateManip-5.42a/t/getnext.t 0100755 0005100 0000104 00000004604 06711124576 014373 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=34;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests ="
Fri Nov 22 1996 17:49:30
sat
0
1996112317:49:30
Fri Nov 22 1996 17:49:30
sat
1
1996112317:49:30
Fri Nov 22 1996 17:49:30
fri
0
1996112917:49:30
Fri Nov 22 1996 17:49:30
5
0
1996112917:49:30
Fri Nov 22 1996 17:49:30
fri
1
1996112217:49:30
Fri Nov 22 1996 17:49:30
fri
0
18:30
1996112918:30:00
Fri Nov 22 1996 17:49:30
fri
0
18:30:45
1996112918:30:45
Fri Nov 22 1996 17:49:30
fri
0
18
30
1996112918:30:00
Fri Nov 22 1996 17:49:30
fri
0
18
30
45
1996112918:30:45
Fri Nov 22 1996 17:49:30
fri
1
14
30
45
1996112214:30:45
Fri Nov 22 1996 17:49:30
fri
2
14
30
45
1996112914:30:45
Fri Nov 22 1996 17:49:30
nil
0
18
1996112218:00:00
Fri Nov 22 1996 17:49:33
nil
0
18:30
1996112218:30:00
Fri Nov 22 1996 17:49:33
nil
0
18
30
1996112218:30:00
Fri Nov 22 1996 17:49:33
nil
0
18:30:45
1996112218:30:45
Fri Nov 22 1996 17:49:33
nil
0
18
30
45
1996112218:30:45
Fri Nov 22 1996 17:49:33
nil
0
18
nil
45
1996112218:00:45
Fri Nov 22 1996 17:00:00
nil
0
17
1996112317:00:00
Fri Nov 22 1996 17:00:00
nil
1
17
1996112217:00:00
Fri Nov 22 1996 17:49:00
nil
0
17
49
1996112317:49:00
Fri Nov 22 1996 17:49:00
nil
1
17
49
1996112217:49:00
Fri Nov 22 1996 17:49:33
nil
0
17
49
33
1996112317:49:33
Fri Nov 22 1996 17:49:33
nil
1
17
49
33
1996112217:49:33
Fri Nov 22 1996 17:00:33
nil
0
17
nil
33
1996112317:00:33
Fri Nov 22 1996 17:00:33
nil
1
17
nil
33
1996112217:00:33
Fri Nov 22 1996 17:49:30
nil
0
nil
30
1996112218:30:00
Fri Nov 22 1996 17:49:30
nil
0
nil
30
45
1996112218:30:45
Fri Nov 22 1996 17:49:30
nil
0
nil
nil
30
1996112217:50:30
Fri Nov 22 1996 17:30:00
nil
0
nil
30
1996112218:30:00
Fri Nov 22 1996 17:30:00
nil
1
nil
30
1996112217:30:00
Fri Nov 22 1996 17:30:45
nil
0
nil
30
45
1996112218:30:45
Fri Nov 22 1996 17:30:45
nil
1
nil
30
45
1996112217:30:45
Fri Nov 22 1996 17:30:45
nil
0
nil
nil
45
1996112217:31:45
Fri Nov 22 1996 17:30:45
nil
1
nil
nil
45
1996112217:30:45
";
print "GetNext...\n";
&test_Func($ntest,\&Date_GetNext,$tests,$runtests);
1;
DateManip-5.42a/t/getprev.t 0100755 0005100 0000104 00000004604 06711123561 014362 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=34;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests ="
Fri Nov 22 1996 17:49:30
thu
0
1996112117:49:30
Fri Nov 22 1996 17:49:30
thu
1
1996112117:49:30
Fri Nov 22 1996 17:49:30
fri
0
1996111517:49:30
Fri Nov 22 1996 17:49:30
5
0
1996111517:49:30
Fri Nov 22 1996 17:49:30
fri
1
1996112217:49:30
Fri Nov 22 1996 17:49:30
fri
0
18:30
1996111518:30:00
Fri Nov 22 1996 17:49:30
fri
0
18:30:45
1996111518:30:45
Fri Nov 22 1996 17:49:30
fri
0
18
30
1996111518:30:00
Fri Nov 22 1996 17:49:30
fri
0
18
30
45
1996111518:30:45
Fri Nov 22 1996 17:49:30
fri
1
18
30
45
1996112218:30:45
Fri Nov 22 1996 17:49:30
fri
2
18
30
45
1996111518:30:45
Fri Nov 22 1996 17:49:30
nil
0
18
1996112118:00:00
Fri Nov 22 1996 17:49:33
nil
0
18:30
1996112118:30:00
Fri Nov 22 1996 17:49:33
nil
0
18
30
1996112118:30:00
Fri Nov 22 1996 17:49:33
nil
0
18:30:45
1996112118:30:45
Fri Nov 22 1996 17:49:33
nil
0
18
30
45
1996112118:30:45
Fri Nov 22 1996 17:49:33
nil
0
18
nil
45
1996112118:00:45
Fri Nov 22 1996 17:00:00
nil
0
17
1996112117:00:00
Fri Nov 22 1996 17:00:00
nil
1
17
1996112217:00:00
Fri Nov 22 1996 17:49:00
nil
0
17
49
1996112117:49:00
Fri Nov 22 1996 17:49:00
nil
1
17
49
1996112217:49:00
Fri Nov 22 1996 17:49:33
nil
0
17
49
33
1996112117:49:33
Fri Nov 22 1996 17:49:33
nil
1
17
49
33
1996112217:49:33
Fri Nov 22 1996 17:00:33
nil
0
17
nil
33
1996112117:00:33
Fri Nov 22 1996 17:00:33
nil
1
17
nil
33
1996112217:00:33
Fri Nov 22 1996 17:49:30
nil
0
nil
30
1996112217:30:00
Fri Nov 22 1996 17:49:30
nil
0
nil
30
45
1996112217:30:45
Fri Nov 22 1996 17:49:30
nil
0
nil
nil
30
1996112217:48:30
Fri Nov 22 1996 17:30:00
nil
0
nil
30
1996112216:30:00
Fri Nov 22 1996 17:30:00
nil
1
nil
30
1996112217:30:00
Fri Nov 22 1996 17:30:45
nil
0
nil
30
45
1996112216:30:45
Fri Nov 22 1996 17:30:45
nil
1
nil
30
45
1996112217:30:45
Fri Nov 22 1996 17:30:45
nil
0
nil
nil
45
1996112217:29:45
Fri Nov 22 1996 17:30:45
nil
1
nil
nil
45
1996112217:30:45
";
print "GetPrev...\n";
&test_Func($ntest,\&Date_GetPrev,$tests,$runtests);
1;
DateManip-5.42a/t/nthday.t 0100755 0005100 0000104 00000001502 07202260731 014164 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=7;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests="
1997
10
1997:1:10:0:0:_0.00
1997
10.5
1997:1:10:12:0:_0.00
1997
10.510763888888889
1997:1:10:12:15:30.00
1997
10.510770138888889
1997:1:10:12:15:30.54
2000
31
2000:1:31:0:0:_0.00
2000
31.5
2000:1:31:12:0:_0.00
2000
32
2000:2:1:0:0:_0.00
";
print "NthDayOfYear...\n";
&test_Func($ntest,\&Test_NthDayOfYear,$tests,$runtests);
sub Test_NthDayOfYear {
my(@tmp)=&Date_NthDayOfYear(@_);
push @tmp,sprintf("%5.2f",pop(@tmp));
return join(":",@tmp);
}
1;
DateManip-5.42a/t/recur_0.t 0100755 0005100 0000104 00000015512 06760340302 014243 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=41;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests ="
1*1:1:1:0:0:0*EASTER
Jan 1 1997
Jan 1 1997
Jan 1 2000
~
1997033000:00:00
1998041200:00:00
1999040400:00:00
*1997-1999:1:1:1:0:0:0*EASTER
~
1997033000:00:00
1998041200:00:00
1999040400:00:00
*1999:1:1,2:6:0:0:0*CWD
~
1999010400:00:00
1999010800:00:00
*1999:1:1,2:6:0:0:0*CWP
~
1998123100:00:00
1999010800:00:00
*1999:1:1,2:6:0:0:0*CWN
~
1999010400:00:00
1999010800:00:00
*1999:1-4:2:0:12:00:00*MD4,PD1,BD2,FW2
~
1999010512:00:00
1999020212:00:00
1999030212:00:00
1999033012:00:00
*1999:1-4:2:0:12:00:00*MD4,PD1,BD2
~
1999010212:00:00
1999013012:00:00
1999022712:00:00
1999032712:00:00
*1999:1-4:2:0:12:00:00*MD4,PD1
~
1999010412:00:00
1999020112:00:00
1999030112:00:00
1999032912:00:00
*1999:1-4:2:0:12:00:00*MD4,PT1
~
1999011112:00:00
1999020812:00:00
1999030812:00:00
1999040512:00:00
*1999:1-4:2:0:12:00:00*MD4,PD7
~
1999011012:00:00
1999020712:00:00
1999030712:00:00
1999040412:00:00
*1999:1-4:2:0:12:00:00*MD4
~
1999011112:00:00
1999020812:00:00
1999030812:00:00
1999040512:00:00
*1999:1-4:2:0:12:00:00*MW3
~
1999011112:00:00
1999020812:00:00
1999030812:00:00
1999041212:00:00
0*1-4:2:0:12:00:00*MW3
Jan 1 1999
Jan 1 1999
Jan 1 2000
~
1999011112:00:00
1999020812:00:00
1999030812:00:00
1999041212:00:00
0:1*2:0:12:00:00*MW3
Jan 1 1999
Jan 1 1999
May 1 1999
~
1999011112:00:00
1999020812:00:00
1999030812:00:00
1999041212:00:00
0:0:0:0:12:0:0
Jan 16 1998 at 12:00
Jan 15 1998 at 00:00
Jan 20 1998 at 00:00
~
1998011500:00:00
1998011512:00:00
1998011600:00:00
1998011612:00:00
1998011700:00:00
1998011712:00:00
1998011800:00:00
1998011812:00:00
1998011900:00:00
1998011912:00:00
0:0:0:1*12,14:0,30:0
Jan 16 1998 at 12:00
Jan 15 1998 at 00:00
Jan 20 1998 at 00:00
~
1998011512:00:00
1998011512:30:00
1998011514:00:00
1998011514:30:00
1998011612:00:00
1998011612:30:00
1998011614:00:00
1998011614:30:00
1998011712:00:00
1998011712:30:00
1998011714:00:00
1998011714:30:00
1998011812:00:00
1998011812:30:00
1998011814:00:00
1998011814:30:00
1998011912:00:00
1998011912:30:00
1998011914:00:00
1998011914:30:00
0:0:0:1:6*0,30:0
Jan 16 1998 at 12:00
Jan 15 1998 at 00:00
Jan 20 1998 at 00:00
~
1998011506:00:00
1998011506:30:00
1998011612:00:00
1998011612:30:00
1998011718:00:00
1998011718:30:00
1998011900:00:00
1998011900:30:00
2:0:0*045:0:0:0
Jan 1 1998
Jan 1 1980
Jan 1 1990
~
1980021400:00:00
1982021400:00:00
1984021400:00:00
1986021400:00:00
1988021400:00:00
2:0:0*045-047:0:0:0
Jan 1 1998
Jan 1 1980
Jan 1 1990
~
1980021400:00:00
1980021500:00:00
1980021600:00:00
1982021400:00:00
1982021500:00:00
1982021600:00:00
1984021400:00:00
1984021500:00:00
1984021600:00:00
1986021400:00:00
1986021500:00:00
1986021600:00:00
1988021400:00:00
1988021500:00:00
1988021600:00:00
2:1:0*0:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1980110100:00:00
1982120100:00:00
1985010100:00:00
1987020100:00:00
1989030100:00:00
0:0:2*2:0:0:0
Jan 16 1998
Jan 1 1998
Feb 28 1998
~
1998011300:00:00
1998012700:00:00
1998021000:00:00
1998022400:00:00
0:0:2*2,4:0:0:0
Jan 16 1998
Jan 1 1998
Feb 28 1998
~
1998010100:00:00
1998011300:00:00
1998011500:00:00
1998012700:00:00
1998012900:00:00
1998021000:00:00
1998021200:00:00
1998022400:00:00
1998022600:00:00
0:1:0*2,31:0:0:0
Jan 1 1998
Jan 1 1998
Jul 1 1998
~
1998010200:00:00
1998013100:00:00
1998020200:00:00
1998030200:00:00
1998033100:00:00
1998040200:00:00
1998050200:00:00
1998053100:00:00
1998060200:00:00
0:1:0*-2:0:0:0
Jan 1 1998
Jan 1 1998
Dec 31 1998
~
1998013000:00:00
1998022700:00:00
1998033000:00:00
1998042900:00:00
1998053000:00:00
1998062900:00:00
1998073000:00:00
1998083000:00:00
1998092900:00:00
1998103000:00:00
1998112900:00:00
1998123000:00:00
0:1*2,-1:0:0:0:0
Jan 1 1998
Jan 1 1998
Jul 1 1998
~
1998010500:00:00
1998011900:00:00
1998020200:00:00
1998021600:00:00
1998030200:00:00
1998032300:00:00
1998040600:00:00
1998042000:00:00
1998050400:00:00
1998052500:00:00
1998060800:00:00
1998062200:00:00
0:1*2,-2:2:0:0:0
Jan 1 1998
Jan 1 1998
Jul 1 1998
~
1998011300:00:00
1998012000:00:00
1998021000:00:00
1998021700:00:00
1998031000:00:00
1998032400:00:00
1998041400:00:00
1998042100:00:00
1998051200:00:00
1998051900:00:00
1998060900:00:00
1998062300:00:00
2:0*10:0:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1981030200:00:00
1983030700:00:00
1985030400:00:00
1987030200:00:00
1989030600:00:00
2:0*10:2:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1981030300:00:00
1983030800:00:00
1985030500:00:00
1987030300:00:00
1989030700:00:00
2*3:0:2,30:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1981030200:00:00
1981033000:00:00
1983030200:00:00
1983033000:00:00
1985030200:00:00
1985033000:00:00
1987030200:00:00
1987033000:00:00
1989030200:00:00
1989033000:00:00
2*3:0:0:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1981030100:00:00
1983030100:00:00
1985030100:00:00
1987030100:00:00
1989030100:00:00
3*2,5:2,-2:0:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1982020800:00:00
1982021500:00:00
1982050300:00:00
1982051700:00:00
1985020400:00:00
1985021100:00:00
1985050600:00:00
1985051300:00:00
1988020800:00:00
1988021500:00:00
1988050200:00:00
1988051600:00:00
3*2,5:2:2:0:0:0
Jan 1 1985
Jan 1 1980
Jan 1 1990
~
1982020900:00:00
1982051100:00:00
1985021200:00:00
1985051400:00:00
1988020900:00:00
1988051000:00:00
*1990,1992:0:0:45:0:0:0
~
1990021400:00:00
1992021400:00:00
*1990,1992:0:0:0:0:0:0
~
1990010100:00:00
1992010100:00:00
*1990,1992:5:0:0:0:0:0
~
1990050100:00:00
1992050100:00:00
*1990,1992:5:0:12:0:0:0
~
1990051200:00:00
1992051200:00:00
*1998:0:12,14:0:0:0:0
~
1998031600:00:00
1998033000:00:00
*1998:0:12,14:2:0:0:0
~
1998031700:00:00
1998033100:00:00
*1998:2:2,-2:0:0:0:0
~
1998020200:00:00
1998020900:00:00
*1998:2:2,-2:2:0:0:0
~
1998021000:00:00
1998021700:00:00
*1998:2:2,-2:2:0:0:0
1998021000:00:00
1998021000:00:00
1998021200:00:00
~
1998021000:00:00
";
print "ParseRecur...\n";
&test_Func($ntest,\&ParseRecur,$tests,$runtests);
1;
DateManip-5.42a/t/recur_1.t 0100755 0005100 0000104 00000003170 06734750745 014262 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=7;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests ="
every 7th day in June 1999
0
1999061500:00:00
1999063000:00:00
~
1999062100:00:00
1999062800:00:00
every 7th day in June 1999
1999061500:00:00
1999061500:00:00
1999063000:00:00
~
1999061500:00:00
1999062200:00:00
1999062900:00:00
every 7th day in June 1999
~
1999060700:00:00
1999061400:00:00
1999062100:00:00
1999062800:00:00
4th day of each month in 1999
~
1999010400:00:00
1999020400:00:00
1999030400:00:00
1999040400:00:00
1999050400:00:00
1999060400:00:00
1999070400:00:00
1999080400:00:00
1999090400:00:00
1999100400:00:00
1999110400:00:00
1999120400:00:00
2nd tuesday of every month in 1999
~
1999011200:00:00
1999020900:00:00
1999030900:00:00
1999041300:00:00
1999051100:00:00
1999060800:00:00
1999071300:00:00
1999081000:00:00
1999091400:00:00
1999101200:00:00
1999110900:00:00
1999121400:00:00
every 2nd tuesday in June 1999
~
1999060100:00:00
1999061500:00:00
1999062900:00:00
every 6th tuesday in 1999
~
1999020900:00:00
1999032300:00:00
1999050400:00:00
1999061500:00:00
1999072700:00:00
1999090700:00:00
1999101900:00:00
1999113000:00:00
";
print "ParseRecur (English)...\n";
&test_Func($ntest,\&ParseRecur,$tests,$runtests);
1;
DateManip-5.42a/t/runtests 0100755 0005100 0000104 00000000067 06251346447 014343 0 ustar sbeck apps #!/bin/sh
for test in *.t ;do
perl -w $test 1
done
DateManip-5.42a/t/settime.t 0100755 0005100 0000104 00000001227 06515134245 014361 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=5;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests="
Jan 1, 1996 at 10:30
12:40
1996010112:40:00
1996010110:30:40
12:40:50
1996010112:40:50
1996010110:30:40
12:40
1996010112:40:00
1996010110:30:40
12
40
1996010112:40:00
1996010110:30:40
12
40
50
1996010112:40:50
";
print "SetTime...\n";
&test_Func($ntest,\&Date_SetTime,$tests,$runtests);
1;
DateManip-5.42a/t/test.pl 0100644 0005100 0000104 00000010634 07602113536 014033 0 ustar sbeck apps #!/usr/local/bin/perl -w
# Sets a couple standard arguments:
@Date::Manip::TestArgs=();
@Date::Manip::TestArgs=qw( PersonalCnf=Manip.cnf
PathSep=!
PersonalCnfPath=./t!.
IgnoreGlobalCnf=1
TZ=EST
);
# This takes a list of strings of the form:
# ARG1
# ...
# ARGn
# NOTE
# EXP
# or
# ARG1
# ...
# ARGn
# NOTE
# ~
# EXP1
# ...
# EXPm
# where ARGi are a list of arguments to pass to the appropriate function,
# NOTE is an optional note to print if the test fails, and EXP is the
# expected result (or list of results). NOTE must begin with the character
# ">". All tests must be separated by a blank line from the next test. If
# EXP starts with a "~", it is treated as approximate.
#
# $funcref is the function to pass the arguments to, $tests is the list of
# newline separated strings, $runtests is a value passed in if it is called
# using the runtests command, @extra are extra arguments which are added
# to the function call.
#
# If $runtests=0, everything is printed. If it equals -N, only test N is
# run. If it equals N, start at test N.
#
# $ntest is the total number of tests.
sub test_Func {
my($ntest,$funcref,$tests,$runtests,@extra)=@_;
my(@tests)=split(/\n/,$tests);
my($comment)="#";
my($test,@args,$note,$exp,$ans,$approx,$ans1,$ans2,$t,@exp)=();
$t=0;
while (@tests) {
# Find the first argument
while(@tests) {
$test=$tests[0];
$test =~ s/^\s+//;
shift(@tests), next if ($test eq "" or $test =~ /^$comment/);
last;
}
$t++;
# Read all arguments, note, and expected value
@args=();
@exp=();
$exp=-1;
while(@tests) {
$test=shift(@tests);
$test =~ s/^\s+//;
last if ($test eq "");
next if ($test =~ /^$comment/);
if ($test eq "nil") {
push(@args,"");
} elsif ($test eq "~") {
$exp=$#args;
} else {
push(@args,$test);
}
}
next if (defined $runtests and $runtests<0 and $t!=-$runtests);
next if (defined $runtests and $runtests>0 and $t<$runtests);
# Separate out the note and expected value
if ($exp == -1) {
@exp=();
$exp=pop(@args);
$exp=~ s/\s+//g;
$exp=~ s/_/ /g;
} else {
@exp=splice(@args,$exp+1);
$exp=join(" ",@exp);
}
$exp=~s/ +/ /g;
$note="";
if ($args[$#args] =~ /^>/) {
$note=pop(@args);
$note =~ s/^>\s*//;
}
# An approximate answer is good to within 10 seconds.
$approx=0;
if ($exp =~ /^~/) {
$approx=1;
$exp=~ s/^~//;
$ans1=DateCalc($exp,"-10");
$ans2=DateCalc($exp,"+10");
}
my(@out,@ans,$tmp,%tmp,@tmp);
@ans=&$funcref(@args,@extra);
while (@ans) {
$tmp=shift(@ans);
if (ref $tmp) {
if (ref $tmp eq "SCALAR") {
unshift(@ans,$$tmp);
} elsif (ref $tmp eq "ARRAY") {
unshift(@ans,"[",@$tmp,"]");
} elsif (ref $tmp eq "HASH") {
%tmp=%$tmp;
@tmp=();
foreach $tmp (sort keys %tmp) {
push(@tmp,$tmp,"=>",$tmp{$tmp});
}
unshift(@ans,"{",@tmp,"}");
} else {
push @out,ref $tmp;
}
} else {
push @out,$tmp;
}
}
$ans=join(" ",@out);
$ans=~s/ +/ /g;
# if (@exp) {
# $ans=join(" ",&$funcref(@args,@extra));
# } else {
# $ans=&$funcref(@args,@extra);
# }
$bad=1;
$bad=0 if ($exp eq $ans or $exp eq "nil" && $ans eq "");
$bad=0 if ($approx and $ans ge $ans1 && $ans le $ans2);
if ($bad) {
warn "########################\n";
warn "Expected = $exp\n";
warn "Got = $ans\n";
warn "========================\n";
foreach $test (@args) {
if (defined $test) {
warn "Test = $test\n";
} else {
warn "Test = nil\n";
}
}
foreach $test (@extra) {
if (defined $test) {
warn "Extra = $test\n";
} else {
warn "Extra = nil\n";
}
}
warn "Note = $note\n" if ($note);
warn "########################\n";
print "not ok $t\n";
} else {
print "ok $t\n" if (! defined $runtests or $runtests==0);
}
}
print "$t tests\n" if (defined $runtests);
print "ntest: $ntest\n" if (defined $runtests && $ntest != $t);
}
1;
DateManip-5.42a/t/unixdate.t 0100755 0005100 0000104 00000001272 06624067422 014533 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=2;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$tests="
Wed Jan 3, 1996 at 8:11:12
%y %Y %m %f %b %h %B %U %W %j %d %e %v %a %A %w %E
96_1996_01__1_Jan_Jan_January_01_01_003_03__3__W_Wed_Wednesday_3_3rd
Wed Jan 3, 1996 at 8:11:12
%H %k %i %I %p %M %S %s %o %z %Z
08__8__8_08_AM_11_12_820674672_820656672_-0500_EST
";
print "UnixDate...\n";
&test_Func($ntest,\&UnixDate,$tests,$runtests);
1;
DateManip-5.42a/t/runtests.bat 0100644 0005100 0000104 00000000052 07316353704 015074 0 ustar sbeck apps for %%i in (dir/b *.t) do perl -w %%i 1
DateManip-5.42a/t/date_russian.t 0100755 0005100 0000104 00000002232 07413111704 015356 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=16;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs,"ForceDate=1997-03-08-12:30:00");
$dates="
Ä×ÁÄÃÁÔØ ÓÅÄØÍÏÇÏ ÉÀÎÑ 1977 16:00:00
1977062716:00:00
04.12.1999
1999120400:00:00
2 ÍÁÑ 2012
2012050200:00:00
2 ÍÁÊ 2012
2012050200:00:00
31/12/2000
2000123100:00:00
3 ÓÅÎ 1975
1975090300:00:00
27 ÏËÔ 2001
2001102700:00:00
ÐÅÒ×ÏÅ ÓÅÎÔÑÂÒÑ 1980
1980090100:00:00
ÄÅËÁÂÒØ 20, 1999
1999122000:00:00
20 ÉÀÌÑ 1987 12:32:20
1987072012:32:20
23:37:20 ÐÅÒ×ÏÅ ÉÀÎÑ 1987
1987060123:37:20
20/12/01 17:27:08
2001122017:27:08
20/12/01 × 17:27:08
2001122017:27:08
20/12/01 × 17Þ27Í08Ó00
2001122017:27:08
17:27:08 20/12/01
2001122017:27:08
4 ÏËÔÑÂÒÑ 1975 4Þ00 ÄÎÑ
1975100416:00:00
";
print "Date (Russian)...\n";
&Date_Init("Language=Russian","DateFormat=non-US","Internal=0");
&test_Func($ntest,\&ParseDate,$dates,$runtests);
1;
DateManip-5.42a/t/testrun.sum 0100644 0005100 0000104 00000000156 07600147046 014750 0 ustar sbeck apps Test Run By sbeck on Wed Dec 18 14:36:06 2002
Native configuration is sparc-sun-solaris2.8
=== tests ===
DateManip-5.42a/t/date_delta_russian.t 0100755 0005100 0000104 00000001244 07413107003 016526 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=2;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
ÓÒÅÄÁ 20 ÎÏÑÂÒÑ 1996 12Þ00
ÎÁÚÁÄ ÎÁ 3 ÄÎÑ 2 ÞÁÓÁ 20 ÍÉÎÕÔ
1996111509:40:00
×ÔÏÒÎÉË 4 ÄÅËÁÂÒÑ 2001 23Þ00
×ÐÅÒÅÄ ÎÁ 1 ÎÅÄÅÌÀ 2 ÄÎÑ 3 ÞÁÓÁ
2001121411:00:00
";
print "DateCalc (Russian,date,delta)...\n";
&Date_Init("Language=Russian","DateFormat=non-US","Internal=0");
&test_Func($ntest,\&DateCalc,$calcs,$runtests,2);
1;
DateManip-5.42a/t/testrun.log 0100755 0005100 0000104 00000000223 07600147046 014723 0 ustar sbeck apps Test Run By sbeck on Wed Dec 18 14:36:06 2002
Native configuration is sparc-sun-solaris2.8
=== tests ===
ERROR: Couldn't find tool init file.
DateManip-5.42a/t/date_delta_sign.t 0100644 0005100 0000104 00000001170 07700077443 016012 0 ustar sbeck apps #!/usr/local/bin/perl -w
require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
require "t/test.pl";
} elsif ( -f "test.pl" ) {
require "test.pl";
} else {
die "ERROR: cannot find test.pl\n";
}
$ntest=4;
print "1..$ntest\n" if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);
$calcs="
2001020304:05:06
+ 2 hours
2001020306:05:06
2001020304:05:06
- 2 hours
2001020302:05:06
2001020304:05:06
+ -2 hours
2001020302:05:06
2001020304:05:06
- -2 hours
2001020306:05:06
";
print "DateCalc (date,delta)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests);
1;
DateManip-5.42a/DateManip.cnf 0100644 0005100 0000104 00000006672 07700570534 014621 0 ustar sbeck apps ################################
# CONFIG VARIABLES
################################
# See Date::Manip man page for a description of all config variables.
# EraseHolidays =
# PersonalCnf = .DateManip.cnf
# PersonalCnfPath = .:~
# Language = English
# DateFormat = US
# TZ = EST
# ConvTZ =
# Internal = 0
# FirstDay = 1
# WorkWeekBeg = 1
# WorkWeekEnd = 5
# WorkDay24Hr = 0
# WorkDayBeg = 08:00
# WorkDayEnd = 17:00
# TomorrowFirst = 1
# DeltaSigns = 0
# Jan1Week1 = 0
# YYtoYYYY = 89
# UpdateCurrTZ = 0
# IntCharSet = 0
# ForceDate =
################################
# HOLIDAYS
################################
*HOLIDAY
# Make sure that the date part of every date can be followed by the year
# and be correctly parsed by ParseDate.
# The following holiday definitions are taken from pcal's config file.
# Some are commented out if these tend to be ordinary business days.
1*1:0:1:0:0:0*NWD = New Year's Day
#1/1 = New Year's Day
third Monday in Feb = Presidents' Day
# 2/14 = Valentine's Day
# 3/17 = St. Patrick's Day
last Monday in May = Memorial Day
# 6/14 = Flag Day
7/4 = Independence Day
1st Monday in Sep = Labor Day
second Monday in Oct = Columbus Day (observed)
# 10/31 = Halloween
#second Mon in Nov = Veterans' Day (observed)
fourth Thu in Nov = Thanksgiving
# 12/24 = Christmas Eve
12/25 = Christmas
# 12/31 = New Year's Eve
# You can also use recurrences.
1*0:0:0:0:0:0*EASTER = Easter
1*11:0:11:0:0:0*CWD = Veteran's Day (observed)
#1*0:0:0:0:0:0*EASTER,PD5 = Good Friday
# Other complex holidays (date + delta, date - delta)
# first Monday in Nov + 1 day = Election day
# The Friday after Thanksgiving is an unnamed holiday some places
# fourth Thu in Nov + 1 day =
# State specific holidays (set for Florida)
# Except AZ, NH, MT
3rd Monday in Jan = Martin Luther King Day
# Alaska
#first Sat in March = Iditarod starts
# Only for MA, ME
#3rd Monday in Apr = Patriots' Day
# You can define specific holidays for specific years
# 1/5/1999 = A one-year-only holiday
# 1st Monday in Sep 1998 = Another one.
################################
# EVENTS
################################
*EVENTS
# These are events that occur over a range of time. Useful for scheduling
# or calendar applications.
# Forms include
# date = event # Sets an event lasting 1 day or 1 hour (if no time)
2000-02-01 = Event1
2000-05-01 = Event2
2000-04-01-12:00:00 = Event3
# recur = event # Sets a recurring event lasting 1 day or 1 hour
1*01:0:10:0:0:0 = Recurring event 1 day long
1*02:0:10:12:0:0 = Recurring event 1 hour long
# date0 ; date1 = event # Sets an event lasting from date0 to date1 inclusive
# (i.e. if date1 doesn't contain a a time, it ends at
# midnight of that date)
2000-01-01 ; 2000-03-21 = Winter
2000-03-22 ; 2000-06-21 = Spring
2000-06-22 ; 2000-09-21 = Summer
2000-09-22 ; 2000-12-21 = Fall
2000-12-22 ; 2000-12-31 = Winter
# recur ; delta = event # Sets an event of this duration
1*03:0:10:12:0:0 ; 0:0:0:0:2:30:0 = Recurring event 2:30 long
DateManip-5.42a/HISTORY 0100644 0005100 0000104 00000113032 07701034571 013335 0 ustar sbeck apps #######################################################################
# HISTORY
#######################################################################
Important changes marked with *** (as of 5.20)
Written by:
Sullivan Beck (sbeck@cpan.org)
Any suggestions, bug reports, or donations :-) should be sent to me.
Version 1.0 1995-01-20
Combined all routines into one library
Version 1.1 1995-02-08
Added leap year checking
Both "Feb" and "February" formats available
Version 1.2 1995-03-31
Made months case insensitive
Added a few date formats
Version 2.0 1995-04-17
Included ideas from packages
Time::ParseDate (David Muir Sharnoff <muir@idiom.com>)
date.pl 3.2 (Terry McGonigal <tmcgonigal@gvc.com>)
Made error checking much nicer
Added seconds to ParseDate
Version 3.0 1995-05-03
Added %DATE_ global variable to clean some stuff up
Simplified several routines
Added today-no/tomorrows/etc. formats
Added UnixDate
Added ParseDateDelta
Version 4.0 1995-08-13
Switched to perl 5
Cleaned up ParseDate, ParseDateDelta
Added time first formats to ParseDate
First public release
Version 4.1 1995-10-18
Changed %DATE_ to %DateManip::Date
Rewrote ParseDateDelta
Added DateCalc
Version 4.2 1995-10-23
UnixDate will now return a scalar or list depending on context
ParseDate/ParseDateDelta will now take a scalar, a reference to a
scalar, or a eference to an array
Added copyright notice (requested by Tim Bunce <Tim.Bunce@ig.co.uk>)
Simple timezone handling
Added Date_SetTime, Date_GetPrev, Date_GetNext
Version 4.3 1995-10-26
Added "which dofw in mmm" formats to ParseDate
Added a bugfix of Adam Nevins where "12:xx pm" used to be parsed
"24:xx:00".
Version 5.00 1996-06-21
Switched to a package (patch supplied by Peter Bray
<pbray@ind.tansu.com.au>)
o renamed to Date::Manip
o changed version number to 2 decimal places
o added POD documentation
Thanks to Peter Bray, Randal Schwartz, Andreas Koenig for suggestions
Fixed a bug pointed out by Peter Bray where it was complaining of
an uninitialized variable.
Version 5.01 1996-06-24
Fixes suggested by Rob Perelman <robp@electriciti.com>
o Fixed a typo (Friday misspelled Fridat)
o Documentation problem for \$err in DateCalc
o Added %F formtat to UnixDate
Reworked a number of the ParseDate regular expressions to make
them more flexible
Added "Date at Time" types
Weekdays can be entered and checked
Two digit years fall in the range CurrYear-89 to CurrYear+10
Version 5.02 1996-07-15
Fixed a bug where repeated calls to ParseDate("today") was not reset
Replaced the %Date::Manip::Date variable with a large number of
other, more flexible variables
Added some internationalization (most of the routines had to be
modified at least slightly)
Rewrote the Init routine
Version 5.03 1996-07-17
Fixed a couple of bugs in UnixDate.
Declared package variables to avoid warning "Identifier XXX used
only once". Thanks to Peter Bray for the suggestion.
Version 5.04 1996-08-01
Added support for fractional seconds (as generated by Sybase). They
are parsed and ignored. Added by Kurt Stephens
<stephens@il.us.swissbank.com>.
Fixed bugs reported by J.B. Nicholson-Owens
<jbn@mystery-train.cu-online.com>
o "Tue Jun 25 1996" wasn't parsed correctly (regexp was case
sensitive)
o full day names not parsed correctly
o the default day in ErrorCheck should be 1, NOT currd since when
currd>28, it may not be a valid date for the month
Version 5.05 1996-10-11
Added Swedish translation (thanks to Andreas Johansson
<Andreas.XS.Johansson@trab.se>
Fixed bad mistake in documentation (use Date::Manip instead of
use DateManip) pointed out by tuc@valhalla.stormking.com
Fixed bug introduced in 5.04 when default day set to 1. When no
date given, have day default to today rather than 1. It only
defaults to one if a partial date is given.
Changed deltas to be all positive or all negative when produced by
DateCalc. Suggested by Steve Braun <braun@gandalf.sp.trw.com>
Fixed bug where Date_DaysSince999 returned the wrong value (the
error did not affect any other functions in Date::Manip due to
the way it was called and the nature of the error). Pointed out
by Jason Baker <bm11455@themis.ag.gov.bc.ca>.
Minor improvements to documentation.
Documented the 'sort within a sort' bug.
Added DateManipVersion routine.
Dates with commas in them are now read properly.
Now supports timezones.
Parses RFC 822 dates (thanks to J.B. Nicholson-Owens
<jbn@mystery-train.cu-online.com> for suggestion).
Parses ctime() date formats (suggested by Matthew R. Sheahan
<chaos@crystal.palace.net>).
Added Date_ConvTZ routine for timezone support.
Fixed two places where a variable was declared twice using my (thanks
to Ric Steinberger <ric@isl.sri.com>).
Hopefully fixed installation problems.
Now supports times like "noon" and "midnight".
Got rid of the last (I think) couple of US specific strings.
The time separators are now language specific so the French can
write "10h30" and the Swedes can write "10.30". Suggested by
Andreas Johansson <Andreas.XS.Johansson@trab.se>.
Fixed type in documentation/README pointed out by James K. Bence
<jbence@math.ucla.edu>.
Fixed bug in Date_SetTime (didn't work with $hr,$min,$sec < 10).
Added ModuloAddition routine and simplified DateCalc.
Date_TimeZone will now also check `date '+%Z'` suggested by
Aharon Schkolnik <aharon@healdb.matat.health.gov.il>.
Version 5.06 1996-10-25
Fixed another two places where a variable was declared twice using my
(thanks to Ric Steinberger <ric@isl.sri.com>).
Fixed a bug where fractional seconds weren't parsed correctly.
Fixed a bug where "noon" and other special times were not parsed
in the "which day of month" formats.
Added "today at time" formats.
Fixed a minor bug where a few matches were case sensitive.
ParseDateDelta now normalizes the delta as well as DateCalc.
Added %Q format "YYYYMMDD" to UnixDate. Requested by Rob Perelman
<robp@electriciti.com>.
The command "date +%Z" doesn't work on SunOS machines (and perhaps
others) so 5.05 is effectively broken. 5.06 released to fix this.
Reported by Rob Perelman <robp@electriciti.com>.
Version 5.07 1996-12-10
Huge number of code changes to clean things up.
Added %q format "YYYYMMDDHHMMSS" to UnixDate. Requested by Rob Perelman
<robp@electriciti.com>. Also added %P format "YYYYMMDDHH:MM:SS".
Added a new config variable to allow you to work with multiple internal
formats (with and without colons). Requested by Rob Perelman
<robp@electriciti.com>. See Date_Init documentation.
Added the following formats suggested by Andreas Johansson
<Andreas.XS.Johansson@trab.se>:
sunday week 22 [in 1996] [at 12:00]
22nd sunday [in 1996] [at 12:00]
sunday 22nd week [in 1996] [at 12:00]
Added weeks to ParseDateDelta. Suggested by Mike Bassman
<mbassman@fia21-43.fiadev21.lehman.com>. Note that since
this is a late addition, I did not change the internal format
of a delta. Instead, it is added to the days field.
Added a new config variable to allow you to define the first day of
the week. See Date_Init documentation.
Added the following formats to ParseDate for conveniance (some were
suggested by Mike Bassman <mbassman@fia21-43.fiadev21.lehman.com>):
next/last friday [at time]
next/last week [at time]
in 2 weeks [at time]
2 weeks ago [at time]
Friday in 2 weeks
in 2 weeks on friday
Friday 2 weeks ago
2 weeks ago friday
Added Date_SecsSince1970GMT, moved the %s format to %o (secs since 1/1/70)
and added %s format (secs since 1/1/70 GMT). Based on suggestions by
Mark Osbourne <marko@lexis-nexis.com>. Note this introduces a minor
backward incompatibility!
Date_SetTime now works with international time separators.
Changed how Date_Init arguments work.
Fixed bug in Date_TimeZone where it didn't recognize +HHMN type time
zones. Thanks to Are Bryne <are.bryne@communique.no>.
Added the %g format (%a, %d %b %Y %H:%M:%S %z) for an RFC 1123 date.
Suggested by Are Bryne <are.bryne@communique.no>.
Added WindowsNT check to Date_TimeZone to get around NT's weird date
command. Thanks to Are Bryne <are.bryne@communique.no>.
Subroutines now check to see if 4 digit years are entered. Suggested
by Are Bryne <are.bryne@communique.no>.
Fixed typo (CSD instead of CST).
Now reads a config file.
Added options to delete existing holidays and ignore global config file.
The d:h:mn:s of ALL deltas are normalized.
Added local($_) to all routines which use $_. Suggested by Rob
Perelman <robp@electriciti.com>.
Date_GetNext and Date_GetPrev now return the next/prev occurence of a
time as well as a day. Suggested by Are Bryne
<are.bryne@communique.no>.
Complete rewrite of DateCalc.
In approximate mode, deltas now come out completely normalized (only 1
sign). Suggested by Rob Perelman <robp@electriciti.com>.
Added business mode. See documentation. Suggested by Mike Bassman
<mbassman@fia21-43.fiadev21.lehman.com>.
Modified how deltas are normalized and added the DeltaSigns config
variable.
Added test suite!
Fixed sign in military timezones making Date::Manip RFC 1123 compliant
(except that timezone information is not stored in any format)
Added Date::Manip::InitDone so initialization isn't duplicated.
Added a 3rd internal format to store YYYY-MM-DD HH:MN:SS (iso 8601).
Fixed a bug where UnixDate %E format didn't work with single digit
dates. Patch supplied by J\yrgen N\yrgaard <jnp@www.ifs.dk>.
Added a config variable to allow you to work with 24 hour business
days. Suggested by Mike Bassman
<mbassman@fia21-43.fiadev21.lehman.com>.
ParseDateDelta now returns "" rather than "+0:0:0:0:0:0" when there is
an error.
Fixed a bug where "today" was not converted to the correct timezone.
Version 5.07p2 1997-01-03
Added lots of timezone abbreviations.
Can now understand PST8PDT type zones (but only in Date_TimeZone).
Fixed some tests (good for another year).
Fixed a bug where a delta component of "-0" would mess things up.
Reported by Nigel Chapman <nigel@macavon.demon.co.uk>.
Released two patches for 5.07.
Version 5.08 1997-01-24
Fixed serious bug in ConvTZ pointed out by David Hall
<dhall@sportsline.com>.
Modified Date_ConvTZ (and documented it).
Released 5.08 to get this and the other two patches into circulation.
Version 5.09 1997-01-28
Upgraded to 5.003_23 and fixed one problem associated with it.
Used carp and changed all die's to confess.
Replaced some UNIX commands with perl equivalents (date with localtime
in the tests, pwd with cwd in the path routines).
Cleaned up all routines working with the path.
Tests work again (broke in 5.08). Thanks to Alex Lewin <lewin@vgi.com>,
and Michael Fuhr <mfuhr@blackhole.dimensional.com> for running
debugging tests.
Version 5.10 1997-03-19
Tests will now run regardless of the timezone you are in.
Test will always read the DateManip.cnf file in t/ now.
A failed test will now give slightly more information.
Cleaned up In, At, and On regexps.
DateManip.cnf file in t/ now sets ALL options to override any changes
made in the Manip.pm file.
Added documentation for backwards incompatibilities to POD.
Added 2 checks for MSWin32 (date command and getpw* didn't work). Thanks
to Alan Humphrey <alanh@velleb.com>.
Fixed two bugs in the DateCalc routines. Pointed out by Kevin Baker
<ol@twics.com>
Fixed some problems in POD documentation. Thanks to Marvin Solomon
<solomon@cs.wisc.edu>.
Fixed some problems with how "US/Eastern" type timezones were used.
Thanks to Marvin Solomon <solomon@cs.wisc.edu>.
Fixed minor POD error pointed out by John Perkins <john@cs.wisc.edu>.
Added a check for Windows_95. Thanks to charliew@atfppc.ppc.att.com.
Changed documentation for Date_IsWorkDay (it was quite confusing using
a variable named $time). Thanks to Erik M. Schwartz
<eriks@library.nrl.navy.mil>.
Cleaned up checks for MacOS and Microsoft OS's. Hopefully I'm catching
everything. Thanks to Charlie Wu <charwu@ibm.net> for one more check.
Fixed typo in docs (midnight mispelled). Thanks to Timothy Kimball
<kimball@stsci.edu>.
Fixed a typo which broke Time%Date (Date=dd%mmm%yy) format. Thanks to
Timothy Kimball <kimball@stsci.edu>.
Version 5.11 1997-08-07
Added one more check for NT perl. Thanks to Rodney Haywood
<rodos@hotspace.net>
Added METDST timezone. Thanks to Paul Gillingwater
<p.gillingwater@iaea.org>
Added CEST timezone. Thanks to Rosella Antonio <antonio.rosella@agip.it>
Added some comments to help me keep my personal libraries up-to-date
with respect to Date::Manip and vice-versa.
Fixed a bug which showed up in French dates (though it could happen in
other languages as well). Thanks to Georges Martin
<georges.martin@deboeck.be>.
Added ROK timezone. Thanks to Kang Taewook <twkang@www.netcenter.co.kr>
Fixed a bug in DateCalc. Thanks to Thomas Winzig <tsw@pvo.com>
Removed the "eval" statement from CheckFilePath which causes a suid
c wrapper program to die when it calls a Date::Manip script.
Thanks to Hank Hughes <thigpen@ccs.neu.edu>
Fixed a bug in business mode calculations. Thanks to Sterling Swartwout
<sterling_swartwout@urgentmail.com>
Fixed a bug in which "1997023100:00:00" was accepted as valid. Thanks
to Doug Emerald <emerald@reston.ans.net>.
Fixed a bug in which ConvTZ was not used correctly in ParseDate. Redid
portions of Date_ConvTZ. Thanks to Vivek Khera <khera@kci.kciLink.com>
Fixed a bug in business mode calculations. Thanks to Ian Duplisse
<duplisse@rentwks1.golden.csc.com>
Added $^X check for Win95 perl. Thanks to Walter.Soldierer@t-online.de
<Walter Soldierer>
Missed one call to NormalizeDelta so the output was wrong. Thanks to
Brad A. Buikema <babuike@sandia.gov>
Version 5.11 was never released to CPAN.
Version 5.20 1997-10-12
Reorganized ParseDate more efficiently.
Fixed some incorrect uses of $in instead of $future in ParseDate.
Thanks to Erik Corry <erik@arbat.com>
Added formats:
*** All ISO 8601 formats
"Friday" suggested by Rob Perelman <robp@electriciti.com>
"12th" suggested by Rob Perelman <robp@electriciti.com>
12th (12th day of current month)
"last day of MONTH" suggested by Chadd Westhoff <CWESTHOFF@cyprus.com>
Added ParseDateString for speed (and simplicity for modifying ParseDate)
Changed all week handling to meet ISO 8601 standards.
Added %J and %K formats to UnixDate.
Added some speedups (more to come).
Cleaned up testing mechanism a bit and added tests for ISO 8601 formats.
Added Date_DaysInMonth.
Version 5.21 1998-01-15
Documented how to get around Micro$oft problem. Based on a mail by
Patrick Stepp <stepp@adelphia.net>
Now passes Taint checks. Thanks to Mike Fuhr <Fuhr.Mike@tci.com>,
Ron E. Nelson <rnelson@mpr.org>, and Jason L Tibbitts III
<tibbs@hpc.uh.edu>
Put everything in a "use integer" pragma.
Added YYtoYYYY variable. Suggested by Michel van der List
<vanderlistmj@sbphrd.com>
Added a missing space in the %g UnixDate format. Thanks to Mike Booth
<booth@bohr.pha.jhu.edu>
Fixed some Australian time zones. Kim Davies <kim@cynosure.com.au>
Removed all mandatory call to Date_Init (only called when current time
is required). Significantly faster.
Added the UpdateCurrTZ variable to increase speed at the cost of being
wrong on the timezone.
Cleaned up multi-lingual initialization and added the IntCharSet
variable.
Improved French translations. Thanks to Emmanuel Bataille
<ebat@micronet.fr>
Fixed a bug in Date_ConvTZ.
Fixed another bug in Date_ConvTZ. Thanks to Patrick K Malone
<malone@bighorn.sdvc.uwyo.edu>
Added "Sept" as a recognized abbreviation. Thanks to Martin Thurn
<mthurn@copper.irnet.rest.tasc.com>
Added British date formats. Piran Montford <piran@cogapp.com>
monday week
today week
as well as some US formats
in 2 months
next month
Time can now be written 5pm. Piran Montford <piran@cogapp.com>
Added the TomorrowFirst variable and Date_NearestWorkDay function.
Fixed a bug in Date_IsWorkDay.
Typo in the French initialization. Thanks to Michel Minsoul
<minsoul@segi.ulg.ac.be>
Fixed how %W and %U was incorrectly stored between weeks 52,53,01.
They now return the correct week (no more week 00). Added UnixDate
formats %G and %L to correctly handle the year. Samuli Karkkainen
<skarkkai@kelloseppakoulu.fi>
Added ForceDate variable.
Fixed the tests to not fail in 1998.
Version 5.30 1998-01-21
*** Added a week field to deltas.
All routines can now take either a 2- or 4-digit year.
Added Delta_Format. First suggested by Alan Burlison
<aburlison@cix.compulink.co.uk>
Added Date_SetDateField. Martin Thurn <mthurn@copper.irnet.rest.tasc.com>
Made the $err argument to DateCalc optional.
Changed the name of several of the library routines (not the callable
ones) to standardize naming.
*** Added ParseRecur. First suggested by Chris Jackson
<chrisj@biddeford.com>
Version 5.31 1998-04-08
Fixed a bug in ParseDateDelta (seems to appear only in 5.005 prereleases).
Found by Larry W. Virden <lvirden@cas.org>
Some fixes to the French translations by Emmanuel Bataille
<ebat@micronet.fr>
Missed one form in ParseDate. Noted by <ttsg@ttsg.com>
Fixed a bug where "15:00:00" couldn't be parsed. Michael Pizolato
<piz@innocent.com>
Relaxed some restrictions on timezones so ISO-8601 dates can use
non-ISO-8601 timezones. Noted by John Chambers <jc@eddie.mit.edu>
Added "epoch SECS" format to ParseDateString. Thanks to: Joshua M. Burgin
<joshua@amazon.com>
Split Manip.pm. New files are HISTORY, TODO, Manip.pod.
Fixed a bug in ParseDateDelta. Antonio Rosella <anface@yahoo.com>
Minor documentation fixes. Will Linden <wlinden@panix.com>
Added German support. Thanks to Andreas C. Poszvek
<h8825393@idefix.wu-wien.ac.at>
Removed the only occurence of $& (which may speed some things up). Fix
by Ken Williams <ken@forum.swarthmore.edu>
Oops. First suggested by Abigal <abigail@fnx.com>
Fixed a bug in converting timezones with a minutes field (+1030). Found
by <paulo@mail.ddnet.es>
Fixed an overflow bug in doing date calculations with 2 dates more than
70 years apart. Fix by Vishal Bhatia <vishalb@hotmail.com>
Added a patch by Blair Zajac <blair@gps.caltech.edu> to make
Date_NthDayOfYear work with decimal days.
Fixed a bug where "5:00pm" wasn't always parsed correctly. Thanks to
Jim Trocki <trockij@transmeta.com>
Fixed a bug in UnixDate (it wouldn't return the correct string for a
format who's last character was '0') noted by Ramin V.
<raminv@hotmail.com>
Fixed a documentation problem with Date_GetPrev. It was still 0-6
instead of 1-7. Thanks to Robert Klep <robert@ilse.nl>
Version 5.32 1998-08-17
Added "in N days" and "N days ago" formats. Tony Bowden <tony@tmtm.com>
Added cYYYY format to YYtoYYYY variable. Mark Rejhon <marky@ottawa.com>
Allowed timezones of the format STD-#DST-#. Peter Gordon
<peter@vhp9.valor.com>
Documentation fix. Peter Gordon <peter@vhp9.valor.com>
Added Hong Kong, Singapore, and Korean timezones. W. Phillip Moore
<wpm@ms.com>
Fixed a bug where the deltas could be off by up to a couple minutes in
some rare cases. Herman Horsten <herman@Belgium.EU.net>
Minor documentation changes. Yamamoto Hiroshi <hiroshi@246.ne.jp>
Fixed an "uninitialized symbol" warning. Mark D. Anderson
<mda@discerning.com>
Added timezone support for "+0500 (EST)". Tom Christiansen
<tchrist@jhereg.perl.com>
Removed support for oldstyle Date_Init arguments.
Fixed a bug where holidays were't erased. Jonathan Wright
<JONATHAN_WRIGHT@Non-HP-Australia-om4.om.hp.com>
Added GB timezone. Michael Smith <mjs@iii.co.uk>
Added Polish support. Ian Wojtowicz <i@woj.com>
Applied a bug fix from Joe Chapman <joe@world.std.com> where the %W/%U
UnixDate formats were frequently wrong.
Added Dutch support. Abigal <abigail@fnx.com>
Added 2 days/weeks/months later in both ParseDate and ParseDelta (for
Dutch support). Abigal <abigail@fnx.com>
Several minor fixes and improvements. Abigal <abigail@fnx.com>
Added some VMS support. Charles Lane <lane@duphy4.drexel.edu>
Fixed a bug which caused a test to fail on some systems. Charles Lane
<lane@duphy4.drexel.edu>
*** Changed DateManip.cnf to Manip.cnf (to get rid of problems with
certain OS's that can't handle filenames that aren't 8.3 characters)
for ALL non-Unix platforms (Wintel, VMS, Mac). For all Unix platforms,
it's still .DateManip.cnf . Also, it will only look in a users home
directory on VMS and Unix.
Added info about the RCS problem. Supplied by Kipp E. Howard
<kipp.e.howard@boeing.com>
Added "Y:M:0*-DOM:0:0:0" to ParseRecur. Jeff Yoak <jeff@yoak.com>
Added A.M. and P.M. parsing (not just AM and PM). William W. Arnold
<warnold@vipnet.org>
Added timezone. Samuli Karkkainen <skarkkai@woods.iki.fi>
Fixed a bug where "-1second" was treated as a date rather than a delta
in DateCalc. Kenneth Ingham <ingham@i-pi.com>
Restricted timzeones parsing to 0000-2359 instead of 0000-9999.
Frank Cusack <fcusack@iconnet.net>.
Added a bit to the Makefile.PL (as it was distributed in the Win32
Perl Resource Kit). Murray Nesbitt <murray@ActiveState.com>
Fixed a German initialization problem. Thomas Horster-Moller
<horster-moeller@vivai.de> and Christian Reithmaier
<reithmaier@04.blf01.telekom400.dbp.de>
Version 5.33 1998-08-20
Added Spanish support. Bautista Jasso Javier <jbautist@autrey.com>
Fixed a bug where "1 month ago" was no longer working (and added it
to the test cases). This broke when I fixed the "-1second" bug
above. A result of this is that a number of "deltas" can be parsed
as dates (i.e. &ParseDate("1 hour 20 minutes ago") is equivalent to
&DateCalc("now","1 hour 20 minutes ago")). Only text deltas can
be used in this way (i.e. &ParseDate("-0:0:0:0:1:20:0") will not
work).
Version 5.34 1999-04-13
Fixed a bug where a date passed in as an array wasn't getting the
date removed from the array. Rick Wise <rwise@lcc.com>
Added tests for MPE/iX OS. John Testa <JOHN.TESTA@w-j.com>
Fixed a bug where WorkDayBeg=8:00 went into an infinite loop.
Mark Martinec <Mark.Martinec@nsc.ijs.si>
A number of typos fixed. Ron Pero <rpero@boone.net>
Added exact business mode. Ian Duplisse <duplisse@rentwks1.golden.csc.com>
Changed a business week to be the same as an exact week. Abigal
<abigail@fnx.com>
Added Portuguese. Rui Pedro da Silva Leite Pereira <rui@um.geira.pt>
*** Switched all variables from Date::Manip::VAR to my(VAR). This means
no more access to Date::Manip internals. Based on suggestion by
Tom Christiansen <tchrist@jhereg.perl.com>
Changed %z UnixDate format to return the GMT offset. TTSG <ttsg@ttsg.com>
The format "22nd sunday" now returns the real 22nd sunday, NOT the sunday
of week 22 (based on whatever definition of week 1 is active).
Fixed a bug where "sunday week 0" didn't work (only affected week 0)
Gerald Rinske <Gerald.Rinske@mch.sni.de>
Minor bug (my variable declared twice). Paul J. Schinder
<schinder@pobox.com>
Added "mmmYYYY" and "YYYYmmm" formats. As a result, "DDYYmmm" and
"mmmDDYY" formats changed to "DD/YYmmm" and "mmmDD/YY". David Twomey
<dtwomey@northernlight.com>
*** Added Date_Cmp routine. This will work even after the new internal
format goes into affect. Added now in response to a question by
Al Sorrell <alsorrell@troweprice.com> (I should have added it earlier).
At the request of the UN, I added the SAT timezone. :-) Howard Hendler
<hendler@un.org>.
Fixed a bug where "epoch SECONDS" was getting parsed wrong (for SECONDS
which could be interpreted as an ISO-8601 date). N. Thomas
<nthomas@cise.ufl.edu>.
Fixed a problem where init files were not being read. Mike Reetz
<miker@iiug.org>
Fixed a bug where timezones were converted multiple times if ConvTZ was
set and DateCalc called. Steven Hartland <steven_hartland@pa.press.net>
Version 5.35 1999-07-06
Added Romanian support (including 2 test files). Iosif Fettich
<ifettich@netsoft.ro>
Made "epoch" not case sensitive and fixed a bug where it would fail in
some languages. Caught because of Iosif's thorough Romanian test file.
Fixed a problem where "in 5 days/weeks/months" sometimes wouldn't get
correctly parsed in other languages. Caught because of Iosif's
thorough Romanian test file.
Fixed a weakness in ParseDateDelta brought out by the Romanian delta test
file.
Corrected Swedish translations. Danne Solli <dsi@xinit.se>
Documentation updates.
Modified Date_GetPrev/Date_GetNext to take $curr=2.
Now parses the Apache log file format "dd/mmm/yyyy:hh:mm:ss (time zone)".
Mark Ferguson <Mark.Ferguson@Stanford.EDU>
Added OS/2 support. Michael B. Babakov <M.Babakov@tnet.sochi.net>
Fixed a bug causing warnings in the beta version of perl. Patch by
Paul Johnson <pjcj@transeda.com>.
Some fixes to German translations. Peter Ehrenberg <pe@dipe.de>
Deprecated the function Date_DaysSince999. It's been replaced by
Date_DaysSince1BC. It will disappear in the next version.
Fixed support for years 0000-0999. Requested by Chris Vaughan
<chris@lim.com>
Many changes to recurrences including:
*** Flags are now supported
Some bug fixes and documentation changes
Added test suite
Added support for Easter (first suggested by Abigal <abigail@fnx.com>)
Fixed a bug where base/date0/date1 not treated correctly
Put all the my'ed global variables in a couple hashes to clean up the
namespace and to make a few future enhancements easier to do.
Added Italian. Nicola Pedrozzi <pedrozzi@cscs.ch>
Added Israel timezones. Oded Cohen <macman@netvision.net.il>
Fixed a bug where business weeks weren't being used correctly. Qian Miao
<qmiao@ml.com>
Improved holiday support considerably:
*** Added support for recurrences and one-year-only holidays (the latter
requested first by Vishal Bhatia <vishalb@hotmail.com>)
Cleaned up holiday variables and redid holiday routines.
Fixed Veteran's day, added Good Friday (off by default). Peter Chen
<petechen@lehman.com>
Fixed a serious typo in the DaysSince1BC routine. Qian Miao <qmiao@ml.com>
Added Date_IsHoliday routine. Joe Pepin <joepepin@att.com>
*** Added the PathSep config variable to improve support for non-Unix paths.
*** Date_Init can now return a list of config variables if called in
array context. Based on a suggestion by Matt Tuttle
<mtuttle@new-breed.com>
Version 5.36 2000-01-21
Fixed a bug in ParseRecur. <ltsao@continuus.co.uk>
Fixed a documentation problem with Date_ConvTZ. Diab Jerius
<dj@head-cfa.harvard.edu>
Fixed a bug is UnixDate (%l format). Jon Hedley <jon@hedley.net>
Fixed a bug in Date_GetNext/Prev. Christoph Haas <haas@netlife.de>
Fixed a bug in Date_IsHoliday. Report and patch by Rolf Beutner
<Rolf.Beutner@telekom.de>
Fixed a bug in UnixDate. Patch by Kurtis D. Rader <krader@sequent.com>
Added support for 24:00:00 to ParseDate. William H Asquith
<wasquith@usgs.gov>
Added SAST timezone. Paul Arzul <patricka@exinet.co.za>
Rewrote IsInt routine based on discussion with Sean Hunter
<sean@uncarved.co.uk> (approximately 30% faster on a SPARC).
Version 5.37 2000-02-14
Fixed the sign on the military timezones. John Scott
<jwscott@aircharter.com>
Set ENV{PATH} to help with taint checking. Joe Lipson <joe@axe.net.au>
Fixed a serious bug where HH:24:00 was broken due to support from 24:00:00.
Scott Egashira <egashira@drizzle.com>
Version 5.38 2000-05-23
*** Added Events section to config file and Events_List routine. Prompted
by Greg Schiedler <Limo@Limo.Net> and paid for by Alan Cezar
<alanc@familyrv.com>
Added support for ISO8601 dates of the format dateTtime. Jason Pierce
<JasonP@netedgesolutions.com>
Fixed "dofw" format to return the day of the current week as documented
instead of next week. Dennis Ingram <dennis.ingram@tab.co.nz>
Fixed some typos. Thanks to Alex Kapranoff
<alex@kapran.bitmcnit.bryansk.su>
Fixed a bug where dates in years 1900, 1800, etc. (but not 2000 or other
400th years) were off by one day in DayOfWeek. Noble Thomas
<nthomas@cise.ufl.edu>
Typo fixed. Jim Hranicky <jfh@cise.ufl.edu>
Added the WEST timezone. Nelson Ferreira <Nelson.Ferreira@bigfoot.com>
Fixed a bug in ParseRecur (2-digit years not treated correctly).
Brian Rectanus <brectanu@cablenet-va.com>
Added MEZ/MESZ timezones. David Harper <david.harper@bigfoot.com>
Got rid of the "use Cwd" and ENV{PATH} lines which means no more taint
problems.
Removed Date_DaysSince999.
Version 5.39 2000-06-27
Added /etc/timezone support to &Date_TimeZone. Dirk Eddelbuettel
<edd@debian.org>
Added Canada/Eastern timezone. Dirk Eddelbuettel <edd@debian.org>
`date` uses the user's path unless taint checking is on.
@::DatePath used instead of @Date::Manip::DatePath incorrectly.
Fixed by John Labovitz <johnl@watchguard.com>.
Fixed a bug where times such as "5 seconds ago" were not changing
over time. Matthew R. Sheahan <chaos@crystal.palace.net>
Added timezones. Eli Selinger <eli@infoinsights.com>
Version 5.40 2001-06-07
Added an example. Philip Jones <phil@lynxafrica.demon.co.uk>
Fixed a warning. Edward Avis <epa98@doc.ic.ac.uk>
Fixed a bug where the date wasn't rolling over when parsing dates
containing only times. James L. Gordon <jlgordon@vanion.com>
Fixed a bug where some times were defaulting to the current time
instead of 00:00:00. Edward Avis <epa98@doc.ic.ac.uk>
Added `date +%Z` support in Date_TimeZone. Mike Bristow
<mike@urgle.com>
Added support for negative values is "epoch SECS" type dates.
Larry Warner <warner@swansystems.com>
Fixed a warning if the timezone is supplied as a +HHMM format.
Viola Mauro <mao_@libero.it>
Fixed a bug in Date_NthDayOfYear with decimal days. Olga Polyakov
<olga@icess.ucsb.edu>
Fixed a bug where ParseDateDelta returned a delta if nothing was
passed in. Jim Hranicky <jfh@cise.ufl.edu>.
Fixed a bug where noon was case sensitive. Bion Pohl <bpohl@deja.com>
Fixed a bug where dateTtime wasn't parsed. Jeremy Brinkley
<jeremy@loudcloud.com>
Fixed South African time zone. David Sieborger <drs@rucus.ru.ac.za>
Fixed a bug in holiday parsing involving recurrences. Jerry Wilcox
<Jerry.Wilcox@ucop.edu>
Added NWD/PWD/DWD flags to ParseRecur. Peter Wyngaard
<peterw@iconnect-inc.com>
Fixed a bug where an invalid date passed to Date_IsWorkDay produced
an error message. Mark Rejhon <markr@globilltech.com>
Fixed a bug where EraseHolidays wasn't taking affect correctly.
Chateauvieux Martial <Martial.Chateauvieux@sfs.siemens.de>
Fixed a bug where the list produced by Date_Init couldn't be passed
back in to Date_Init. James Elson <James@citria.com>
Fixed a typo in the docs. Zhen Liu <zhen_hua_liu2@yahoo.com>
Version 5.41 2003-06-30
Added runtests.bat contributed by Lon Amick <lon.g.amick@mail.sprint.com>
Added JAVT timezone. David Coppit <david@coppit.org>
Fixed bug where -HH:MM and +HH:MM were not being accepted as valid
timezones. Hank Barta <hbarta@htc.com>
Small patch for OpenVMS. Martin P.J. Zinser <zinser@decus.de>
Minor doc fix. Jeremy Tietsort <jrtietsort@micron.com>
Added BRST timezone. Daniel Serodio <dserodio@email.com>
Added Russian translation. Dapi <dapi@mail.ru>
Made the UnixDate %Z format work with numeric timezones. Michael Isard
<michael.isard@compaq.com>
Minor bug fix where /etc/timezone not correctly read. Jacek Nowacki
<jacekn@polcard.com.pl>
Added ART timezone. Fabian Mandelbaum <fabman@mandrakesoft.com>
Minor enhancement to ParseRecur. Randy Harmon <rjh@fortheweb.com
Fixed spelling of Veteran's day. Dirk Eddelbuettel <edd@debian.org>
Documentation improvements. James Olsen <jolsen@multiad.com>
Added Brazilian timezones. Raul Dias <raul@dias.com.br>
Fixed WEST timezone. Pedro Melo CUNHA <melo@isp.novis.pt>
Added NOVST timezone. Roman Y Malakhov <roman@intis.tomsk.ru>
Additions to Dutch translation. Willem <itsme@xs4all.nl>
Fixed a bug where timezones -HH:MM weren't handled in ISO 8601 dates.
Ed Avis <ed@membled.com>
Fixed a bug involving business deltas with negative hours. Ludovic
Dubost <ludovic@pobox.com>
Modified Delta_Format to treat the entire delta as exact if no month
component is present. Due to discussion with Tim Turner
<torrid@mindspring.com>
Added EAT timezone. David Whiting <dave@pluto.ammp>
Added BOT timezone. Khaled Mostaguir <Khaled.Mostaguir@isb-sib.ch>
Added several Australian timezones. Jason King
<Jason.King1@team.telstra.com>
Added some support for NetWare. Chris Shields <cshields@waubonsee.edu>
Added some help for VMS timezones. Don Slutz <DSlutz@arrayinc.com>
Applied some robustness patches. Ed Avis <ed@membled.com>
Fixed a bug with years <1000. Jonathan Callahan
<Jonathan.S.Callahan@noaa.gov>
Patch to make Manip.pm -Mstrict clean and better VMS support.
Peter Prymmer <PPrymmer@factset.com>
Patch to French support. Patrick Turmel <patrick@espacecourbe.com>
Added Tues/Thur abbreviations. <mthurn@cise.ufl.edu>
Fixed a bug in "1st saturday of 2005" format. Maurice Aubrey
<maurice@redweek.com>
Taint check insecure $ENV{PATH} fix. Ed Avis <ed@membled.com>
Patch to allow deltas of the form "+ -1 day" to work. Ed Avis
<ed@membled.com>
Added Turkish. <giray@pultar.org>
Added Danish. Jesper Dalberg <dalberg@cybercity.dk>
Added some checking to the timezone determination. Ed Avis
<ed@membled.com>
***Replaced all non-ASCII characters with hex representations to avoid
the malformed UTF-8 character warnings. Ed Avis <ed@membled.com>
Removed ampersands from function calls in documentation to fit new
perl coding standards. Bill Pollock <billp@statenet.com>
Fixed a bug where spaces in a date caused problems in German (due
to the number 1st, 2nd, etc. being 1., 2., etc.). Erik Roderwald
<erik@roderwald.de>
Version 5.42 2003-07-02
Number changed to distinguish between the development release (5.41)
and official release since.
Version 5.42a 2003-07-03
A quick fix to replace a faulty test.
#########################################################################
# Backwards incompatibilities
#########################################################################
Version 5.07
%s UnixDate format changed
By default, the signs of a diff are stored in a different format (only
minimum number of signs stored). Backwards compatible if you set
DeltaSigns=1.
Date_Init arguments changed (old method supported but depreciated)
Version 5.20
ISO 8601 dates added, several old formats are no longer available
MM-DD-YY (conflicts with YY-MM-DD)
YYMMDD (conflicts with YYYYMM)
In keeping with ISO 8601, the weekdays are now numbered 1-7 (mon-sun)
instead of 0-6 (sun-sat).
Also for ISO 8601, the week starts with Monday by default.
By default, the first week of the year contains Jan 4 (ISO 8601).
Version 5.21
Long running process timezone may slip. See UpdateCurrTZ variable.
UnixDate formats %W,%U no longer return week 00. %J is now correct.
Version 5.30
Delta now contains a week field.
Version 5.32
Old style Date_Init arguments no longer supported.
The DateManip.cnf file's name has changed for ALL non-Unix platforms.
Version 5.34
A business week is now interpreted the same as an exact week.
*** All Date::Manip variables are declared with my(VAR), so no
more access to internals.
%z UnixDate format now returns the timezone as a GMT offset. %Z still
returns the abbreviation.
The format "22nd sunday" now returns the real 22nd sunday, NOT the sunday
of week 22 (based on whatever definition of week 1 is active).
"DDYYmmm" and "mmmDDYY" formats changed to "DD/YYmmm" and "mmmDD/YY".
*** Date_Cmp added in preparation for the change in internal format to
include the timezone.
Version 5.35
Deprecated the function Date_DaysSince999. It's been replaced by
Date_DaysSince1BC. It will disappear in the next version.
*** Added the PathSep variable which may cause problems on WinXX platforms
with old config files where a colon is assumed.
Version 5.38
Removed Date_DaysSince999.
Version 5.41
For VMS, changed the path separator to "\n" since ":" is a part of some
paths.
Changed the behavior of Delta_Format slightly.
DateManip-5.42a/INSTALL 0100644 0005100 0000104 00000003244 06736713762 013322 0 ustar sbeck apps Before you install Date::Manip, check out the variables at the top of
Manip.pm. You may want to modify some of the configuration variables.
All variables are documented in the POD documentation included in the
Manip.pod file.
The TZ variable is perhaps the most important of these variables. If
you get the error:
ERROR: Date::Manip unable to determine TimeZone.
Date::Manip was unable to automatically determine your timezone. In
this case, you will need to set the TZ variable appropriately.
AUTOMATIC INSTALLATION
To install, just type
perl Makefile.PL
make
make test
make install
MANUAL INSTALLATION
Some people have reported problems with the automatic installation above.
If the above fails, installing manually is very simple. Just do the
following:
Take a look at the value of @INC in a perl script (run the debugger and
print @INC). In any of the directories that it lists, create a directory
named Date. Copy Date/Manip.pm to this directory.
In our installation, I have installed DateManip as:
/usr/local/lib/perl5/site_perl/Date/Manip.pm
Make sure that in your perl script you have the line:
use Date::Manip;
You can also create the man page using the command:
pod2man Manip.pod > Date::Manip.3
and install it somewhere in your MANPATH. I have it in:
/usr/local/man/man3/Date::Manip.3
To test it, cd to the "t" directory and run the "runtests" command.
TESTS
A few of the tests may fail. Some will fail if they are run on a very slow
computer (it will compare two different times that were supposed to be the
same but aren't because a measurable amount of time passed between
determining the time in two different ways).
DateManip-5.42a/MANIFEST 0100644 0005100 0000104 00000001270 07701034510 013373 0 ustar sbeck apps DateManip.cnf
HISTORY
INSTALL
MANIFEST
Makefile.PL
Manip.pm
Manip.pod
README
TODO
t/Manip.cnf
t/date.t
t/date_date_0.t
t/date_date_1.t
t/date_date_2a.t
t/date_date_2b.t
t/date_delta_0.t
t/date_delta_1.t
t/date_delta_2a.t
t/date_delta_2b.t
t/date_delta_sign.t
t/date_delta_french.t
t/date_delta_russian.t
t/date_french.t
t/date_german.t
t/date_misc_a.t
t/date_misc_b.t
t/date_romanian.t
t/date_russian.t
t/delta_a.t
t/delta_b.t
t/delta_delta_0.t
t/delta_delta_1.t
t/delta_delta_2a.t
t/delta_delta_2b.t
t/delta_format.t
t/delta_romanian.t
t/events.t
t/getnext.t
t/getprev.t
t/nthday.t
t/recur_0.t
t/recur_1.t
t/runtests
t/runtests.bat
t/settime.t
t/test.pl
t/testrun.log
t/testrun.sum
t/unixdate.t
DateManip-5.42a/Makefile.PL 0100644 0005100 0000104 00000000462 07036451111 014217 0 ustar sbeck apps use ExtUtils::MakeMaker;
WriteMakefile(
NAME => "Date::Manip",
VERSION_FROM => "Manip.pm",
($] >= 5.005
? (ABSTRACT => 'Routines for parsing/manipulating dates and time.',
AUTHOR => 'Sullivan Beck (sbeck@cpan.org)')
: ()),
'dist' => {COMPRESS=>'gzip',SUFFIX=>'gz'}
);
DateManip-5.42a/Makefile.old 0100644 0005100 0000104 00000044075 07700601364 014477 0 ustar sbeck apps # This Makefile is for the Date::Manip extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.03 (Revision: 1.63) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# ABSTRACT => q[Routines for parsing/manipulating dates and time.]
# AUTHOR => q[Sullivan Beck (sbeck@cpan.org)]
# NAME => q[Date::Manip]
# VERSION_FROM => q[Manip.pm]
# dist => { COMPRESS=>q[gzip], SUFFIX=>q[gz] }
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/local/lib/perl5/5.8.0/sun4-solaris/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = gcc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -R /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE
DLEXT = so
DLSRC = dl_dlopen.xs
LD = gcc
LDDLFLAGS = -G -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = solaris
OSVERS = 2.8
RANLIB = :
SO = so
EXE_EXT =
FULL_AR = /usr/ccs/bin/ar
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
NAME = Date::Manip
DISTNAME = Date-Manip
NAME_SYM = Date_Manip
VERSION = 5.41
VERSION_SYM = 5_41
XS_VERSION = 5.41
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
INST_BIN = blib/bin
INST_LIB = blib/lib
INSTALLDIRS = site
PREFIX = /usr/local
SITEPREFIX = /usr/local
VENDORPREFIX =
INSTALLPRIVLIB = /usr/local/lib/perl5/5.8.0
INSTALLSITELIB = /usr/local/lib/perl5/site_perl
INSTALLVENDORLIB =
INSTALLARCHLIB = /usr/local/lib/perl5/5.8.0/sun4-solaris
INSTALLSITEARCH = /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
INSTALLVENDORARCH =
INSTALLBIN = /usr/local/bin
INSTALLSITEBIN = /usr/local/bin
INSTALLVENDORBIN =
INSTALLSCRIPT = /usr/local/bin
PERL_LIB = /usr/local/lib/perl5/5.8.0
PERL_ARCHLIB = /usr/local/lib/perl5/5.8.0/sun4-solaris
SITELIBEXP = /usr/local/lib/perl5/site_perl
SITEARCHEXP = /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE
PERL = /usr/local/bin/perl
FULLPERL = /usr/local/bin/perl
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERL = $(PERL)
ABSPERLRUN = $(ABSPERL)
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULL_AR = /usr/ccs/bin/ar
PERL_CORE = 0
NOOP = $(SHELL) -c true
NOECHO = @
VERSION_MACRO = VERSION
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
MAKEMAKER = /usr/local/lib/perl5/5.8.0/ExtUtils/MakeMaker.pm
MM_VERSION = 6.03
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Date/Manip
BASEEXT = Manip
PARENT_NAME = Date
DLBASE = $(BASEEXT)
VERSION_FROM = Manip.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
# Handy lists of source code files:
XS_FILES=
C_FILES =
O_FILES =
H_FILES =
MAN1PODS =
MAN3PODS = Manip.pod
INST_MAN1DIR = blib/man1
MAN1EXT = 1
INSTALLMAN1DIR = /usr/local/man/man1
INSTALLSITEMAN1DIR = /usr/local/man/man$(MAN1EXT)
INST_MAN3DIR = blib/man3
MAN3EXT = 3
INSTALLMAN3DIR = /usr/local/man/man3
INSTALLSITEMAN3DIR = /usr/local/man/man$(MAN3EXT)
PERM_RW = 644
PERM_RWX = 755
# work around a famous dec-osf make(1) feature(?):
makemakerdflt: all
.SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
# some make implementations will delete the Makefile when we rebuild it. Because
# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
# does so. Our milage may vary.
# .PRECIOUS: Makefile # seems to be not necessary anymore
.PHONY: all config static dynamic test linkext manifest
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
# Where to put things:
INST_LIBDIR = $(INST_LIB)/Date
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Date
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC =
INST_DYNAMIC =
INST_BOOT =
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = Danish.pl \
Manip.pm \
Manip.pod \
z.pl
PM_TO_BLIB = Danish.pl \
blib/lib/Date/Danish.pl \
Manip.pm \
blib/lib/Date/Manip.pm \
z.pl \
blib/lib/Date/z.pl \
Manip.pod \
blib/lib/Date/Manip.pod
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = gcc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
# The following is a portable way to say mkdir -p
# To see which directories are created, change the if 0 to if 1
MKPATH = $(PERLRUN) "-MExtUtils::Command" -e mkpath
# This helps us to minimize the effect of the .exists files A yet
# better solution would be to have a stable file in the perl
# distribution with a timestamp of zero. But this solution doesn't
# need any changes to the core distribution and works with older perls
EQUALIZE_TIMESTAMP = $(PERLRUN) "-MExtUtils::Command" -e eqtime
# Here we warn users that an old packlist file was found somewhere,
# and that they should call some uninstall routine
WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \
-e 'print "WARNING: I have found an old package in\n";' \
-e 'print "\t$$ARGV[0].\n";' \
-e 'print "Please make sure the two installations are not conflicting\n";'
UNINST=0
VERBINST=0
MOD_INSTALL = $(PERL) "-I$(INST_LIB)" "-I$(PERL_LIB)" "-MExtUtils::Install" \
-e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \
-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \
-e 'print "=over 4";' \
-e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
-e 'print "=back";'
UNINSTALL = $(PERLRUN) "-MExtUtils::Install" \
-e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \
-e 'print " packlist above carefully.\n There may be errors. Remove the";' \
-e 'print " appropriate files manually.\n Sorry for the inconveniences.\n"'
# --- MakeMaker dist section:
ZIPFLAGS = -r
TO_UNIX = @$(NOOP)
TAR = tar
POSTOP = @$(NOOP)
ZIP = zip
DIST_DEFAULT = tardist
CI = ci -u
SHAR = shar
COMPRESS = gzip
DIST_CP = best
PREOP = @$(NOOP)
TARFLAGS = cvf
DISTVNAME = $(DISTNAME)-$(VERSION)
SUFFIX = gz
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
# --- MakeMaker const_loadlibs section:
# --- MakeMaker const_cccmd section:
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIB="$(LIB)"\
LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"\
OPTIMIZE="$(OPTIMIZE)"\
PASTHRU_DEFINE="$(PASTHRU_DEFINE)"\
PASTHRU_INC="$(PASTHRU_INC)"
# --- MakeMaker c_o section:
# --- MakeMaker xs_c section:
# --- MakeMaker xs_o section:
# --- MakeMaker top_targets section:
all :: pure_all manifypods
@$(NOOP)
pure_all :: config pm_to_blib subdirs linkext
@$(NOOP)
subdirs :: $(MYEXTLIB)
@$(NOOP)
config :: Makefile $(INST_LIBDIR)/.exists
@$(NOOP)
config :: $(INST_ARCHAUTODIR)/.exists
@$(NOOP)
config :: $(INST_AUTODIR)/.exists
@$(NOOP)
$(INST_AUTODIR)/.exists :: /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h
@$(MKPATH) $(INST_AUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h $(INST_AUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
$(INST_LIBDIR)/.exists :: /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h
@$(MKPATH) $(INST_LIBDIR)
@$(EQUALIZE_TIMESTAMP) /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h $(INST_LIBDIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
$(INST_ARCHAUTODIR)/.exists :: /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h
@$(MKPATH) $(INST_ARCHAUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
config :: $(INST_MAN3DIR)/.exists
@$(NOOP)
$(INST_MAN3DIR)/.exists :: /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h
@$(MKPATH) $(INST_MAN3DIR)
@$(EQUALIZE_TIMESTAMP) /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h $(INST_MAN3DIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
help:
perldoc ExtUtils::MakeMaker
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
@$(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make dynamic"
#dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT)
@$(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP =
# --- MakeMaker dynamic_lib section:
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
#static :: Makefile $(INST_STATIC) $(INST_PM)
static :: Makefile $(INST_STATIC)
@$(NOOP)
# --- MakeMaker static_lib section:
# --- MakeMaker manifypods section:
POD2MAN_EXE = /usr/local/bin/pod2man
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \
-e 'print "Manifying $$m{$$_}\n";' \
-e 'system(q[$(PERLRUN) $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
-e 'chmod(oct($(PERM_RW)), $$m{$$_}) or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
manifypods : pure_all Manip.pod
@$(POD2MAN) \
Manip.pod \
$(INST_MAN3DIR)/Date::Manip.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean ::
-rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core
-mv Makefile Makefile.old $(DEV_NULL)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean
rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
rm -rf $(DISTVNAME)
rm -f blib/lib/Date/Danish.pl blib/lib/Date/Manip.pm blib/lib/Date/z.pl
rm -f blib/lib/Date/Manip.pod
rm -rf Makefile Makefile.old
# --- MakeMaker dist_basics section:
distclean :: realclean distcheck
$(NOECHO) $(NOOP)
distcheck :
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
skipcheck :
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
$(RM_F) *~ *.orig */*~ */*.orig
# --- MakeMaker dist_core section:
dist : $(DIST_DEFAULT)
@$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
-e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";'
tardist : $(DISTVNAME).tar$(SUFFIX)
zipdist : $(DISTVNAME).zip
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) \
$(DISTVNAME).tar$(SUFFIX) > \
$(DISTVNAME).tar$(SUFFIX)_uu
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
# --- MakeMaker dist_dir section:
distdir :
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
# --- MakeMaker dist_test section:
disttest : distdir
cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
# --- MakeMaker dist_ci section:
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \
-e "@all = keys %{ maniread() };" \
-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \
-e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
# --- MakeMaker install section:
install :: all pure_install doc_install
install_perl :: all pure_perl_install doc_perl_install
install_site :: all pure_site_install doc_site_install
install_vendor :: all pure_vendor_install doc_vendor_install
pure_install :: pure_$(INSTALLDIRS)_install
doc_install :: doc_$(INSTALLDIRS)_install
@echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
pure__install : pure_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
@$(MOD_INSTALL) \
read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLPRIVLIB) \
$(INST_ARCHLIB) $(INSTALLARCHLIB) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(SITEARCHEXP)/auto/$(FULLEXT)
pure_site_install ::
@$(MOD_INSTALL) \
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLSITELIB) \
$(INST_ARCHLIB) $(INSTALLSITEARCH) \
$(INST_BIN) $(INSTALLSITEBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLSITEMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
pure_vendor_install ::
@$(MOD_INSTALL) \
$(INST_LIB) $(INSTALLVENDORLIB) \
$(INST_ARCHLIB) $(INSTALLVENDORARCH) \
$(INST_BIN) $(INSTALLVENDORBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR)
doc_perl_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLARCHLIB)/perllocal.pod
doc_site_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLSITEARCH)/perllocal.pod
doc_vendor_install ::
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
uninstall_from_perldirs ::
@$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
uninstall_from_sitedirs ::
@$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
@$(NOOP)
# --- MakeMaker perldepend section:
# --- MakeMaker makefile section:
# We take a very conservative approach here, but it\'s worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
Makefile : Makefile.PL $(CONFIGDEP)
@echo "Makefile out-of-date with respect to $?"
@echo "Cleaning current config before rebuilding Makefile..."
-@$(RM_F) Makefile.old
-@$(MV) Makefile Makefile.old
-$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP)
$(PERLRUN) Makefile.PL
@echo "==> Your Makefile has been rebuilt. <=="
@echo "==> Please rerun the make command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = perl
FULLPERL = /usr/local/bin/perl
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) -f $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
@echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
@$(PERLRUNINST) \
Makefile.PL DIR= \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES = t/*.t
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
test_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: test_dynamic
testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
@$(PERL) -e "print qq{<SOFTPKG NAME=\"$(DISTNAME)\" VERSION=\"5,41,0,0\">\n\t<TITLE>$(DISTNAME)</TITLE>\n\t<ABSTRACT>Routines for parsing/manipulating dates and time.</ABSTRACT>\n\t<AUTHOR>Sullivan Beck (sbeck\@cpan.org)</AUTHOR>\n}" > $(DISTNAME).ppd
@$(PERL) -e "print qq{\t<IMPLEMENTATION>\n}" >> $(DISTNAME).ppd
@$(PERL) -e "print qq{\t\t<OS NAME=\"$(OSNAME)\" />\n\t\t<ARCHITECTURE NAME=\"sun4-solaris\" />\n\t\t<CODEBASE HREF=\"\" />\n\t</IMPLEMENTATION>\n</SOFTPKG>\n}" >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
@$(PERLRUNINST) "-MExtUtils::Install" \
-e "pm_to_blib({qw{Danish.pl blib/lib/Date/Danish.pl Manip.pm blib/lib/Date/Manip.pm z.pl blib/lib/Date/z.pl Manip.pod blib/lib/Date/Manip.pod}},'$(INST_LIB)/auto','$(PM_FILTER)')"
@$(TOUCH) $@
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.
DateManip-5.42a/Manip.pm 0100644 0005100 0000104 00000710174 07700605607 013670 0 ustar sbeck apps package Date::Manip;
# Copyright (c) 1995-2003 Sullivan Beck. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
###########################################################################
###########################################################################
use vars qw($OS %Lang %Holiday %Events %Curr %Cnf %Zone $VERSION @ISA @EXPORT);
# Determine the type of OS...
$OS="Unix";
$OS="Windows" if ((defined $^O and
$^O =~ /MSWin32/i ||
$^O =~ /Windows_95/i ||
$^O =~ /Windows_NT/i) ||
(defined $ENV{OS} and
$ENV{OS} =~ /MSWin32/i ||
$ENV{OS} =~ /Windows_95/i ||
$ENV{OS} =~ /Windows_NT/i));
$OS="Netware" if (defined $^O and
$^O =~ /NetWare/i);
$OS="Mac" if ((defined $^O and
$^O =~ /MacOS/i) ||
(defined $ENV{OS} and
$ENV{OS} =~ /MacOS/i));
$OS="MPE" if (defined $^O and
$^O =~ /MPE/i);
$OS="OS2" if (defined $^O and
$^O =~ /os2/i);
$OS="VMS" if (defined $^O and
$^O =~ /VMS/i);
# Determine if we're doing taint checking
$Date::Manip::NoTaint = eval { local $^W; unlink "$^X$^T"; 1 };
###########################################################################
# CUSTOMIZATION
###########################################################################
#
# See the section of the POD documentation section CUSTOMIZING DATE::MANIP
# below for a complete description of each of these variables.
# Location of a the global config file. Tilde (~) expansions are allowed.
# This should be set in Date_Init arguments.
$Cnf{"GlobalCnf"}="";
$Cnf{"IgnoreGlobalCnf"}="";
# Name of a personal config file and the path to search for it. Tilde (~)
# expansions are allowed. This should be set in Date_Init arguments or in
# the global config file.
@Date::Manip::DatePath=();
if ($OS eq "Windows") {
$Cnf{"PathSep"} = ";";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "Netware") {
$Cnf{"PathSep"} = ";";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "MPE") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "OS2") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "Mac") {
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".";
} elsif ($OS eq "VMS") {
# VMS doesn't like files starting with "."
$Cnf{"PathSep"} = "\n";
$Cnf{"PersonalCnf"} = "Manip.cnf";
$Cnf{"PersonalCnfPath"} = ".\n~";
} else {
# Unix
$Cnf{"PathSep"} = ":";
$Cnf{"PersonalCnf"} = ".DateManip.cnf";
$Cnf{"PersonalCnfPath"} = ".:~";
@Date::Manip::DatePath=qw(/bin /usr/bin /usr/local/bin);
}
### Date::Manip variables set in the global or personal config file
# Which language to use when parsing dates.
$Cnf{"Language"}="English";
# 12/10 = Dec 10 (US) or Oct 12 (anything else)
$Cnf{"DateFormat"}="US";
# Local timezone
$Cnf{"TZ"}="";
# Timezone to work in (""=local, "IGNORE", or a timezone)
$Cnf{"ConvTZ"}="";
# Date::Manip internal format (0=YYYYMMDDHH:MN:SS, 1=YYYYHHMMDDHHMNSS)
$Cnf{"Internal"}=0;
# First day of the week (1=monday, 7=sunday). ISO 8601 says monday.
$Cnf{"FirstDay"}=1;
# First and last day of the work week (1=monday, 7=sunday)
$Cnf{"WorkWeekBeg"}=1;
$Cnf{"WorkWeekEnd"}=5;
# If non-nil, a work day is treated as 24 hours long (WorkDayBeg/WorkDayEnd
# ignored)
$Cnf{"WorkDay24Hr"}=0;
# Start and end time of the work day (any time format allowed, seconds
# ignored)
$Cnf{"WorkDayBeg"}="08:00";
$Cnf{"WorkDayEnd"}="17:00";
# If "today" is a holiday, we look either to "tomorrow" or "yesterday" for
# the nearest business day. By default, we'll always look "tomorrow"
# first.
$Cnf{"TomorrowFirst"}=1;
# Erase the old holidays
$Cnf{"EraseHolidays"}="";
# Set this to non-zero to be produce completely backwards compatible deltas
$Cnf{"DeltaSigns"}=0;
# If this is 0, use the ISO 8601 standard that Jan 4 is in week 1. If 1,
# make week 1 contain Jan 1.
$Cnf{"Jan1Week1"}=0;
# 2 digit years fall into the 100 year period given by [ CURR-N,
# CURR+(99-N) ] where N is 0-99. Default behavior is 89, but other useful
# numbers might be 0 (forced to be this year or later) and 99 (forced to be
# this year or earlier). It can also be set to "c" (current century) or
# "cNN" (i.e. c18 forces the year to bet 1800-1899). Also accepts the
# form cNNNN to give the 100 year period NNNN to NNNN+99.
$Cnf{"YYtoYYYY"}=89;
# Set this to 1 if you want a long-running script to always update the
# timezone. This will slow Date::Manip down. Read the POD documentation.
$Cnf{"UpdateCurrTZ"}=0;
# Use an international character set.
$Cnf{"IntCharSet"}=0;
# Use this to force the current date to be set to this:
$Cnf{"ForceDate"}="";
###########################################################################
require 5.000;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(
DateManipVersion
Date_Init
ParseDateString
ParseDate
ParseRecur
Date_Cmp
DateCalc
ParseDateDelta
UnixDate
Delta_Format
Date_GetPrev
Date_GetNext
Date_SetTime
Date_SetDateField
Date_IsHoliday
Events_List
Date_DaysInMonth
Date_DayOfWeek
Date_SecsSince1970
Date_SecsSince1970GMT
Date_DaysSince1BC
Date_DayOfYear
Date_DaysInYear
Date_WeekOfYear
Date_LeapYear
Date_DaySuffix
Date_ConvTZ
Date_TimeZone
Date_IsWorkDay
Date_NextWorkDay
Date_PrevWorkDay
Date_NearestWorkDay
Date_NthDayOfYear
);
use strict;
use integer;
use Carp;
use IO::File;
$VERSION="5.42";
########################################################################
########################################################################
$Curr{"InitLang"} = 1; # Whether a language is being init'ed
$Curr{"InitDone"} = 0; # Whether Init_Date has been called
$Curr{"InitFilesRead"} = 0;
$Curr{"ResetWorkDay"} = 1;
$Curr{"Debug"} = "";
$Curr{"DebugVal"} = "";
$Holiday{"year"} = 0;
$Holiday{"dates"} = {};
$Holiday{"desc"} = {};
$Events{"raw"} = [];
$Events{"parsed"} = 0;
$Events{"dates"} = [];
$Events{"recur"} = [];
########################################################################
########################################################################
# THESE ARE THE MAIN ROUTINES
########################################################################
########################################################################
# Get rid of a problem with old versions of perl
no strict "vars";
# This sorts from longest to shortest element
sub sortByLength {
return (length $b <=> length $a);
}
use strict "vars";
sub DateManipVersion {
print "DEBUG: DateManipVersion\n" if ($Curr{"Debug"} =~ /trace/);
return $VERSION;
}
sub Date_Init {
print "DEBUG: Date_Init\n" if ($Curr{"Debug"} =~ /trace/);
$Curr{"Debug"}="";
my(@args)=@_;
$Curr{"InitDone"}=1;
local($_)=();
my($internal,$firstday)=();
my($var,$val,$file,@tmp)=();
# InitFilesRead = 0 : no conf files read yet
# 1 : global read, no personal read
# 2 : personal read
$Cnf{"EraseHolidays"}=0;
foreach (@args) {
s/\s*$//;
s/^\s*//;
/^(\S+) \s* = \s* (.+)$/x;
($var,$val)=($1,$2);
if ($var =~ /^GlobalCnf$/i) {
$Cnf{"GlobalCnf"}=$val;
if ($val) {
$Curr{"InitFilesRead"}=0;
&EraseHolidays();
}
} elsif ($var =~ /^PathSep$/i) {
$Cnf{"PathSep"}=$val;
} elsif ($var =~ /^PersonalCnf$/i) {
$Cnf{"PersonalCnf"}=$val;
$Curr{"InitFilesRead"}=1 if ($Curr{"InitFilesRead"}==2);
} elsif ($var =~ /^PersonalCnfPath$/i) {
$Cnf{"PersonalCnfPath"}=$val;
$Curr{"InitFilesRead"}=1 if ($Curr{"InitFilesRead"}==2);
} elsif ($var =~ /^IgnoreGlobalCnf$/i) {
$Curr{"InitFilesRead"}=1 if ($Curr{"InitFilesRead"}==0);
$Cnf{"IgnoreGlobalCnf"}=1;
} elsif ($var =~ /^EraseHolidays$/i) {
&EraseHolidays();
} else {
push(@tmp,$_);
}
}
@args=@tmp;
# Read global config file
if ($Curr{"InitFilesRead"}<1 && ! $Cnf{"IgnoreGlobalCnf"}) {
$Curr{"InitFilesRead"}=1;
if ($Cnf{"GlobalCnf"}) {
$file=&ExpandTilde($Cnf{"GlobalCnf"});
&Date_InitFile($file) if ($file);
}
}
# Read personal config file
if ($Curr{"InitFilesRead"}<2) {
$Curr{"InitFilesRead"}=2;
if ($Cnf{"PersonalCnf"} and $Cnf{"PersonalCnfPath"}) {
$file=&SearchPath($Cnf{"PersonalCnf"},$Cnf{"PersonalCnfPath"},"r");
&Date_InitFile($file) if ($file);
}
}
foreach (@args) {
s/\s*$//;
s/^\s*//;
/^(\S+) \s* = \s* (.*)$/x;
($var,$val)=($1,$2);
$val="" if (! defined $val);
&Date_SetConfigVariable($var,$val);
}
confess "ERROR: Unknown FirstDay in Date::Manip.\n"
if (! &IsInt($Cnf{"FirstDay"},1,7));
confess "ERROR: Unknown WorkWeekBeg in Date::Manip.\n"
if (! &IsInt($Cnf{"WorkWeekBeg"},1,7));
confess "ERROR: Unknown WorkWeekEnd in Date::Manip.\n"
if (! &IsInt($Cnf{"WorkWeekEnd"},1,7));
confess "ERROR: Invalid WorkWeek in Date::Manip.\n"
if ($Cnf{"WorkWeekEnd"} <= $Cnf{"WorkWeekBeg"});
my(%lang,
$tmp,%tmp,$tmp2,@tmp2,
$i,$j,@tmp3,
$zonesrfc,@zones)=();
my($L)=$Cnf{"Language"};
if ($Curr{"InitLang"}) {
$Curr{"InitLang"}=0;
if ($L eq "English") {
&Date_Init_English(\%lang);
} elsif ($L eq "French") {
&Date_Init_French(\%lang);
} elsif ($L eq "Swedish") {
&Date_Init_Swedish(\%lang);
} elsif ($L eq "German") {
&Date_Init_German(\%lang);
} elsif ($L eq "Polish") {
&Date_Init_Polish(\%lang);
} elsif ($L eq "Dutch" ||
$L eq "Nederlands") {
&Date_Init_Dutch(\%lang);
} elsif ($L eq "Spanish") {
&Date_Init_Spanish(\%lang);
} elsif ($L eq "Portuguese") {
&Date_Init_Portuguese(\%lang);
} elsif ($L eq "Romanian") {
&Date_Init_Romanian(\%lang);
} elsif ($L eq "Italian") {
&Date_Init_Italian(\%lang);
} elsif ($L eq "Russian") {
&Date_Init_Russian(\%lang);
} elsif ($L eq "Turkish") {
&Date_Init_Turkish(\%lang);
} elsif ($L eq "Danish") {
&Date_Init_Danish(\%lang);
} else {
confess "ERROR: Unknown language in Date::Manip.\n";
}
# variables for months
# Month = "(jan|january|feb|february ... )"
# MonL = [ "Jan","Feb",... ]
# MonthL = [ "January","February", ... ]
# MonthH = { "january"=>1, "jan"=>1, ... }
$Lang{$L}{"MonthH"}={};
$Lang{$L}{"MonthL"}=[];
$Lang{$L}{"MonL"}=[];
&Date_InitLists([$lang{"month_name"},
$lang{"month_abb"}],
\$Lang{$L}{"Month"},"lc,sort,back",
[$Lang{$L}{"MonthL"},
$Lang{$L}{"MonL"}],
[$Lang{$L}{"MonthH"},1]);
# variables for day of week
# Week = "(mon|monday|tue|tuesday ... )"
# WL = [ "M","T",... ]
# WkL = [ "Mon","Tue",... ]
# WeekL = [ "Monday","Tudesday",... ]
# WeekH = { "monday"=>1,"mon"=>1,"m"=>1,... }
$Lang{$L}{"WeekH"}={};
$Lang{$L}{"WeekL"}=[];
$Lang{$L}{"WkL"}=[];
$Lang{$L}{"WL"}=[];
&Date_InitLists([$lang{"day_name"},
$lang{"day_abb"}],
\$Lang{$L}{"Week"},"lc,sort,back",
[$Lang{$L}{"WeekL"},
$Lang{$L}{"WkL"}],
[$Lang{$L}{"WeekH"},1]);
&Date_InitLists([$lang{"day_char"}],
"","lc",
[$Lang{$L}{"WL"}],
[\%tmp,1]);
%{ $Lang{$L}{"WeekH"} } =
(%{ $Lang{$L}{"WeekH"} },%tmp);
# variables for last
# Last = "(last)"
# LastL = [ "last" ]
# Each = "(each)"
# EachL = [ "each" ]
# variables for day of month
# DoM = "(1st|first ... 31st)"
# DoML = [ "1st","2nd",... "31st" ]
# DoMH = { "1st"=>1,"first"=>1, ... "31st"=>31 }
# variables for week of month
# WoM = "(1st|first| ... 5th|last)"
# WoMH = { "1st"=>1, ... "5th"=>5,"last"=>-1 }
$Lang{$L}{"LastL"}=$lang{"last"};
&Date_InitStrings($lang{"last"},
\$Lang{$L}{"Last"},"lc,sort");
$Lang{$L}{"EachL"}=$lang{"each"};
&Date_InitStrings($lang{"each"},
\$Lang{$L}{"Each"},"lc,sort");
$Lang{$L}{"DoMH"}={};
$Lang{$L}{"DoML"}=[];
&Date_InitLists([$lang{"num_suff"},
$lang{"num_word"}],
\$Lang{$L}{"DoM"},"lc,sort,back,escape",
[$Lang{$L}{"DoML"},
\@tmp],
[$Lang{$L}{"DoMH"},1]);
@tmp=();
foreach $tmp (keys %{ $Lang{$L}{"DoMH"} }) {
$tmp2=$Lang{$L}{"DoMH"}{$tmp};
if ($tmp2<6) {
$Lang{$L}{"WoMH"}{$tmp} = $tmp2;
push(@tmp,$tmp);
}
}
foreach $tmp (@{ $Lang{$L}{"LastL"} }) {
$Lang{$L}{"WoMH"}{$tmp} = -1;
push(@tmp,$tmp);
}
&Date_InitStrings(\@tmp,\$Lang{$L}{"WoM"},
"lc,sort,back,escape");
# variables for AM or PM
# AM = "(am)"
# PM = "(pm)"
# AmPm = "(am|pm)"
# AMstr = "AM"
# PMstr = "PM"
&Date_InitStrings($lang{"am"},\$Lang{$L}{"AM"},"lc,sort,escape");
&Date_InitStrings($lang{"pm"},\$Lang{$L}{"PM"},"lc,sort,escape");
&Date_InitStrings([ @{$lang{"am"}},@{$lang{"pm"}} ],\$Lang{$L}{"AmPm"},
"lc,back,sort,escape");
$Lang{$L}{"AMstr"}=$lang{"am"}[0];
$Lang{$L}{"PMstr"}=$lang{"pm"}[0];
# variables for expressions used in parsing deltas
# Yabb = "(?:y|yr|year|years)"
# Mabb = similar for months
# Wabb = similar for weeks
# Dabb = similar for days
# Habb = similar for hours
# MNabb = similar for minutes
# Sabb = similar for seconds
# Repl = { "abb"=>"replacement" }
# Whenever an abbreviation could potentially refer to two different
# strings (M standing for Minutes or Months), the abbreviation must
# be listed in Repl instead of in the appropriate Xabb values. This
# only applies to abbreviations which are substrings of other values
# (so there is no confusion between Mn and Month).
&Date_InitStrings($lang{"years"} ,\$Lang{$L}{"Yabb"}, "lc,sort");
&Date_InitStrings($lang{"months"} ,\$Lang{$L}{"Mabb"}, "lc,sort");
&Date_InitStrings($lang{"weeks"} ,\$Lang{$L}{"Wabb"}, "lc,sort");
&Date_InitStrings($lang{"days"} ,\$Lang{$L}{"Dabb"}, "lc,sort");
&Date_InitStrings($lang{"hours"} ,\$Lang{$L}{"Habb"}, "lc,sort");
&Date_InitStrings($lang{"minutes"},\$Lang{$L}{"MNabb"},"lc,sort");
&Date_InitStrings($lang{"seconds"},\$Lang{$L}{"Sabb"}, "lc,sort");
$Lang{$L}{"Repl"}={};
&Date_InitHash($lang{"replace"},undef,"lc",$Lang{$L}{"Repl"});
# variables for special dates that are offsets from now
# Now = "(now|today)"
# Offset = "(yesterday|tomorrow)"
# OffsetH = { "yesterday"=>"-0:0:0:1:0:0:0",... ]
# Times = "(noon|midnight)"
# TimesH = { "noon"=>"12:00:00","midnight"=>"00:00:00" }
# SepHM = hour/minute separator
# SepMS = minute/second separator
# SepSS = second/fraction separator
$Lang{$L}{"TimesH"}={};
&Date_InitHash($lang{"times"},
\$Lang{$L}{"Times"},"lc,sort,back",
$Lang{$L}{"TimesH"});
&Date_InitStrings($lang{"now"},\$Lang{$L}{"Now"},"lc,sort");
$Lang{$L}{"OffsetH"}={};
&Date_InitHash($lang{"offset"},
\$Lang{$L}{"Offset"},"lc,sort,back",
$Lang{$L}{"OffsetH"});
$Lang{$L}{"SepHM"}=$lang{"sephm"};
$Lang{$L}{"SepMS"}=$lang{"sepms"};
$Lang{$L}{"SepSS"}=$lang{"sepss"};
# variables for time zones
# zones = regular expression with all zone names (EST)
# n2o = a hash of all parsable zone names with their offsets
# tzones = reguar expression with all tzdata timezones (US/Eastern)
# tz2z = hash of all tzdata timezones to full timezone (EST#EDT)
$zonesrfc=
"idlw -1200 ". # International Date Line West
"nt -1100 ". # Nome
"hst -1000 ". # Hawaii Standard
"cat -1000 ". # Central Alaska
"ahst -1000 ". # Alaska-Hawaii Standard
"akst -0900 ". # Alaska Standard
"yst -0900 ". # Yukon Standard
"hdt -0900 ". # Hawaii Daylight
"akdt -0800 ". # Alaska Daylight
"ydt -0800 ". # Yukon Daylight
"pst -0800 ". # Pacific Standard
"pdt -0700 ". # Pacific Daylight
"mst -0700 ". # Mountain Standard
"mdt -0600 ". # Mountain Daylight
"cst -0600 ". # Central Standard
"cdt -0500 ". # Central Daylight
"est -0500 ". # Eastern Standard
"act -0500 ". # Brazil, Acre
"sat -0400 ". # Chile
"bot -0400 ". # Bolivia
"amt -0400 ". # Brazil, Amazon
"acst -0400 ". # Brazil, Acre Daylight
"edt -0400 ". # Eastern Daylight
"ast -0400 ". # Atlantic Standard
#"nst -0330 ". # Newfoundland Standard nst=North Sumatra +0630
"nft -0330 ". # Newfoundland
#"gst -0300 ". # Greenland Standard gst=Guam Standard +1000
#"bst -0300 ". # Brazil Standard bst=British Summer +0100
"brt -0300 ". # Brazil Standard (official time)
"brst -0300 ". # Brazil Standard
"adt -0300 ". # Atlantic Daylight
"art -0300 ". # Argentina
"amst -0300 ". # Brazil, Amazon Daylight
"ndt -0230 ". # Newfoundland Daylight
"brst -0200 ". # Brazil Daylight (official time)
"fnt -0200 ". # Brazil, Fernando de Noronha
"at -0200 ". # Azores
"wat -0100 ". # West Africa
"fnst -0100 ". # Brazil, Fernando de Noronha Daylight
"gmt +0000 ". # Greenwich Mean
"ut +0000 ". # Universal
"utc +0000 ". # Universal (Coordinated)
"wet +0000 ". # Western European
"cet +0100 ". # Central European
"fwt +0100 ". # French Winter
"met +0100 ". # Middle European
"mez +0100 ". # Middle European
"mewt +0100 ". # Middle European Winter
"swt +0100 ". # Swedish Winter
"bst +0100 ". # British Summer bst=Brazil standard -0300
"gb +0100 ". # GMT with daylight savings
"west +0000 ". # Western European Daylight
"eet +0200 ". # Eastern Europe, USSR Zone 1
"cest +0200 ". # Central European Summer
"fst +0200 ". # French Summer
"ist +0200 ". # Israel standard
"mest +0200 ". # Middle European Summer
"mesz +0200 ". # Middle European Summer
"metdst +0200 ". # An alias for mest used by HP-UX
"sast +0200 ". # South African Standard
"sst +0200 ". # Swedish Summer sst=South Sumatra +0700
"bt +0300 ". # Baghdad, USSR Zone 2
"eest +0300 ". # Eastern Europe Summer
"eetedt +0300 ". # Eastern Europe, USSR Zone 1
"idt +0300 ". # Israel Daylight
"msk +0300 ". # Moscow
"eat +0300 ". # East Africa
"it +0330 ". # Iran
"zp4 +0400 ". # USSR Zone 3
"msd +0400 ". # Moscow Daylight
"zp5 +0500 ". # USSR Zone 4
"ist +0530 ". # Indian Standard
"zp6 +0600 ". # USSR Zone 5
"novst +0600 ". # Novosibirsk time zone, Russia
"nst +0630 ". # North Sumatra nst=Newfoundland Std -0330
#"sst +0700 ". # South Sumatra, USSR Zone 6 sst=Swedish Summer +0200
"javt +0700 ". # Java
"hkt +0800 ". # Hong Kong
"sgt +0800 ". # Singapore
"cct +0800 ". # China Coast, USSR Zone 7
"awst +0800 ". # Australian Western Standard
"wst +0800 ". # West Australian Standard
"pht +0800 ". # Asia Manila
"kst +0900 ". # Republic of Korea
"jst +0900 ". # Japan Standard, USSR Zone 8
"rok +0900 ". # Republic of Korea
"acst +0930 ". # Australian Central Standard
"cast +0930 ". # Central Australian Standard
"aest +1000 ". # Australian Eastern Standard
"east +1000 ". # Eastern Australian Standard
"gst +1000 ". # Guam Standard, USSR Zone 9 gst=Greenland Std -0300
"acdt +1030 ". # Australian Central Daylight
"cadt +1030 ". # Central Australian Daylight
"aedt +1100 ". # Australian Eastern Daylight
"eadt +1100 ". # Eastern Australian Daylight
"idle +1200 ". # International Date Line East
"nzst +1200 ". # New Zealand Standard
"nzt +1200 ". # New Zealand
"nzdt +1300 ". # New Zealand Daylight
"z +0000 ".
"a +0100 b +0200 c +0300 d +0400 e +0500 f +0600 g +0700 h +0800 ".
"i +0900 k +1000 l +1100 m +1200 ".
"n -0100 o -0200 p -0300 q -0400 r -0500 s -0600 t -0700 u -0800 ".
"v -0900 w -1000 x -1100 y -1200";
$Zone{"n2o"} = {};
($Zone{"zones"},%{ $Zone{"n2o"} })=
&Date_Regexp($zonesrfc,"sort,lc,under,back",
"keys");
$tmp=
"US/Pacific PST8PDT ".
"US/Mountain MST7MDT ".
"US/Central CST6CDT ".
"US/Eastern EST5EDT ".
"Canada/Pacific PST8PDT ".
"Canada/Mountain MST7MDT ".
"Canada/Central CST6CDT ".
"Canada/Eastern EST5EDT";
$Zone{"tz2z"} = {};
($Zone{"tzones"},%{ $Zone{"tz2z"} })=
&Date_Regexp($tmp,"lc,under,back","keys");
$Cnf{"TZ"}=&Date_TimeZone;
# misc. variables
# At = "(?:at)"
# Of = "(?:in|of)"
# On = "(?:on)"
# Future = "(?:in)"
# Later = "(?:later)"
# Past = "(?:ago)"
# Next = "(?:next)"
# Prev = "(?:last|previous)"
&Date_InitStrings($lang{"at"}, \$Lang{$L}{"At"}, "lc,sort");
&Date_InitStrings($lang{"on"}, \$Lang{$L}{"On"}, "lc,sort");
&Date_InitStrings($lang{"future"},\$Lang{$L}{"Future"}, "lc,sort");
&Date_InitStrings($lang{"later"}, \$Lang{$L}{"Later"}, "lc,sort");
&Date_InitStrings($lang{"past"}, \$Lang{$L}{"Past"}, "lc,sort");
&Date_InitStrings($lang{"next"}, \$Lang{$L}{"Next"}, "lc,sort");
&Date_InitStrings($lang{"prev"}, \$Lang{$L}{"Prev"}, "lc,sort");
&Date_InitStrings($lang{"of"}, \$Lang{$L}{"Of"}, "lc,sort");
# calc mode variables
# Approx = "(?:approximately)"
# Exact = "(?:exactly)"
# Business = "(?:business)"
&Date_InitStrings($lang{"exact"}, \$Lang{$L}{"Exact"}, "lc,sort");
&Date_InitStrings($lang{"approx"}, \$Lang{$L}{"Approx"}, "lc,sort");
&Date_InitStrings($lang{"business"},\$Lang{$L}{"Business"},"lc,sort");
############### END OF LANGUAGE INITIALIZATION
}
if ($Curr{"ResetWorkDay"}) {
my($h1,$m1,$h2,$m2)=();
if ($Cnf{"WorkDay24Hr"}) {
($Curr{"WDBh"},$Curr{"WDBm"})=(0,0);
($Curr{"WDEh"},$Curr{"WDEm"})=(24,0);
$Curr{"WDlen"}=24*60;
$Cnf{"WorkDayBeg"}="00:00";
$Cnf{"WorkDayEnd"}="23:59";
} else {
confess "ERROR: Invalid WorkDayBeg in Date::Manip.\n"
if (! (($h1,$m1)=&CheckTime($Cnf{"WorkDayBeg"})));
$Cnf{"WorkDayBeg"}="$h1:$m1";
confess "ERROR: Invalid WorkDayEnd in Date::Manip.\n"
if (! (($h2,$m2)=&CheckTime($Cnf{"WorkDayEnd"})));
$Cnf{"WorkDayEnd"}="$h2:$m2";
($Curr{"WDBh"},$Curr{"WDBm"})=($h1,$m1);
($Curr{"WDEh"},$Curr{"WDEm"})=($h2,$m2);
# Work day length = h1:m1 or 0:len (len minutes)
$h1=$h2-$h1;
$m1=$m2-$m1;
if ($m1<0) {
$h1--;
$m1+=60;
}
$Curr{"WDlen"}=$h1*60+$m1;
}
$Curr{"ResetWorkDay"}=0;
}
# current time
my($s,$mn,$h,$d,$m,$y,$wday,$yday,$isdst,$ampm,$wk)=();
if ($Cnf{"ForceDate"}=~
/^(\d{4})-(\d{2})-(\d{2})-(\d{2}):(\d{2}):(\d{2})$/) {
($y,$m,$d,$h,$mn,$s)=($1,$2,$3,$4,$5,$6);
} else {
($s,$mn,$h,$d,$m,$y,$wday,$yday,$isdst)=localtime(time);
$y+=1900;
$m++;
}
&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk);
$Curr{"Y"}=$y;
$Curr{"M"}=$m;
$Curr{"D"}=$d;
$Curr{"H"}=$h;
$Curr{"Mn"}=$mn;
$Curr{"S"}=$s;
$Curr{"AmPm"}=$ampm;
$Curr{"Now"}=&Date_Join($y,$m,$d,$h,$mn,$s);
$Curr{"Debug"}=$Curr{"DebugVal"};
# If we're in array context, let's return a list of config variables
# that could be passed to Date_Init to get the same state as we're
# currently in.
if (wantarray) {
# Some special variables that have to be in a specific order
my(@special)=qw(IgnoreGlobalCnf GlobalCnf PersonalCnf PersonalCnfPath);
my(%tmp)=map { $_,1 } @special;
my(@tmp,$key,$val);
foreach $key (@special) {
$val=$Cnf{$key};
push(@tmp,"$key=$val");
}
foreach $key (keys %Cnf) {
next if (exists $tmp{$key});
$val=$Cnf{$key};
push(@tmp,"$key=$val");
}
return @tmp;
}
return ();
}
sub ParseDateString {
print "DEBUG: ParseDateString\n" if ($Curr{"Debug"} =~ /trace/);
local($_)=@_;
return "" if (! $_);
my($y,$m,$d,$h,$mn,$s,$i,$wofm,$dofw,$wk,$tmp,$z,$num,$err,$iso,$ampm)=();
my($date,$z2,$delta,$from,$falsefrom,$to,$which,$midnight)=();
# We only need to reinitialize if we have to determine what NOW is.
&Date_Init() if (! $Curr{"InitDone"} or $Cnf{"UpdateCurrTZ"});
my($L)=$Cnf{"Language"};
my($type)=$Cnf{"DateFormat"};
# Mode is set in DateCalc. ParseDate only overrides it if the string
# contains a mode.
if ($Lang{$L}{"Exact"} &&
s/$Lang{$L}{"Exact"}//) {
$Curr{"Mode"}=0;
} elsif ($Lang{$L}{"Approx"} &&
s/$Lang{$L}{"Approx"}//) {
$Curr{"Mode"}=1;
} elsif ($Lang{$L}{"Business"} &&
s/$Lang{$L}{"Business"}//) {
$Curr{"Mode"}=2;
} elsif (! exists $Curr{"Mode"}) {
$Curr{"Mode"}=0;
}
# Unfortunately, some deltas can be parsed as dates. An example is
# 1 second == 1 2nd == 1 2
# But, some dates can be parsed as deltas. The most important being:
# 1998010101:00:00
# We'll check to see if a "date" can be parsed as a delta. If so, we'll
# assume that it is a delta (since they are much simpler, it is much
# less likely that we'll mistake a delta for a date than vice versa)
# unless it is an ISO-8601 date.
#
# This is important because we are using DateCalc to test whether a
# string is a date or a delta. Dates are tested first, so we need to
# be able to pass a delta into this routine and have it correctly NOT
# interpreted as a date.
#
# We will insist that the string contain something other than digits and
# colons so that the following will get correctly interpreted as a date
# rather than a delta:
# 12:30
# 19980101
$delta="";
$delta=&ParseDateDelta($_) if (/[^:0-9]/);
# Put parse in a simple loop for an easy exit.
PARSE: {
my(@tmp)=&Date_Split($_);
if (@tmp) {
($y,$m,$d,$h,$mn,$s)=@tmp;
last PARSE;
}
# Fundamental regular expressions
my($month)=$Lang{$L}{"Month"}; # (jan|january|...)
my(%month)=%{ $Lang{$L}{"MonthH"} }; # { jan=>1, ... }
my($week)=$Lang{$L}{"Week"}; # (mon|monday|...)
my(%week)=%{ $Lang{$L}{"WeekH"} }; # { mon=>1, monday=>1, ... }
my($wom)=$Lang{$L}{"WoM"}; # (1st|...|fifth|last)
my(%wom)=%{ $Lang{$L}{"WoMH"} }; # { 1st=>1,... fifth=>5,last=>-1 }
my($dom)=$Lang{$L}{"DoM"}; # (1st|first|...31st)
my(%dom)=%{ $Lang{$L}{"DoMH"} }; # { 1st=>1, first=>1, ... }
my($ampmexp)=$Lang{$L}{"AmPm"}; # (am|pm)
my($timeexp)=$Lang{$L}{"Times"}; # (noon|midnight)
my($now)=$Lang{$L}{"Now"}; # (now|today)
my($offset)=$Lang{$L}{"Offset"}; # (yesterday|tomorrow)
my($zone)=$Zone{"zones"} . '(?:\s+|$)'; # (edt|est|...)\s+
my($day)='\s*'.$Lang{$L}{"Dabb"}; # \s*(?:d|day|days)
my($mabb)='\s*'.$Lang{$L}{"Mabb"}; # \s*(?:mon|month|months)
my($wkabb)='\s*'.$Lang{$L}{"Wabb"}; # \s*(?:w|wk|week|weeks)
my($next)='\s*'.$Lang{$L}{"Next"}; # \s*(?:next)
my($prev)='\s*'.$Lang{$L}{"Prev"}; # \s*(?:last|previous)
my($past)='\s*'.$Lang{$L}{"Past"}; # \s*(?:ago)
my($future)='\s*'.$Lang{$L}{"Future"}; # \s*(?:in)
my($later)='\s*'.$Lang{$L}{"Later"}; # \s*(?:later)
my($at)=$Lang{$L}{"At"}; # (?:at)
my($of)='\s*'.$Lang{$L}{"Of"}; # \s*(?:in|of)
my($on)='(?:\s*'.$Lang{$L}{"On"}.'\s*|\s+)';
# \s*(?:on)\s* or \s+
my($last)='\s*'.$Lang{$L}{"Last"}; # \s*(?:last)
my($hm)=$Lang{$L}{"SepHM"}; # :
my($ms)=$Lang{$L}{"SepMS"}; # :
my($ss)=$Lang{$L}{"SepSS"}; # .
# Other regular expressions
my($D4)='(\d{4})'; # 4 digits (yr)
my($YY)='(\d{4}|\d{2})'; # 2 or 4 digits (yr)
my($DD)='(\d{2})'; # 2 digits (mon/day/hr/min/sec)
my($D) ='(\d{1,2})'; # 1 or 2 digit (mon/day/hr)
my($FS)="(?:$ss\\d+)?"; # fractional secs
my($sep)='[\/.-]'; # non-ISO8601 m/d/yy separators
# absolute time zone +0700 (GMT)
my($hzone)='(?:[0-1][0-9]|2[0-3])'; # 00 - 23
my($mzone)='(?:[0-5][0-9])'; # 00 - 59
my($zone2)='(?:\s*([+-](?:'."$hzone$mzone|$hzone:$mzone|$hzone))".
# +0700 +07:00 -07
'(?:\s*\([^)]+\))?)'; # (GMT)
# A regular expression for the time EXCEPT for the hour part
my($mnsec)="$hm$DD(?:$ms$DD$FS)?(?:\\s*$ampmexp)?";
# A special regular expression for /YYYY:HH:MN:SS used by Apache
my($apachetime)='(/\d{4}):' . "$DD$hm$DD$ms$DD";
my($time)="";
$ampm="";
$date="";
# Substitute all special time expressions.
if (/(^|[^a-z])$timeexp($|[^a-z])/i) {
$tmp=$2;
$tmp=$Lang{$L}{"TimesH"}{lc($tmp)};
s/(^|[^a-z])$timeexp($|[^a-z])/$1 $tmp $3/i;
}
# Remove some punctuation
s/[,]/ /g;
# Make sure that ...7EST works (i.e. a timezone immediately following
# a digit.
s/(\d)$zone(\s+|$|[0-9])/$1 $2$3/i;
$zone = '\s+'.$zone;
# Remove the time
$iso=1;
$midnight=0;
$from="24${hm}00(?:${ms}00)?";
$falsefrom="${hm}24${ms}00"; # Don't trap XX:24:00
$to="00${hm}00${ms}00";
$midnight=1 if (!/$falsefrom/ && s/$from/$to/);
$h=$mn=$s=0;
if (/$D$mnsec/i || /$ampmexp/i) {
$iso=0;
$tmp=0;
$tmp=1 if (/$mnsec$zone2?\s*$/i); # or /$mnsec$zone/ ??
$tmp=0 if (/$ampmexp/i);
if (s/$apachetime$zone()/$1 /i ||
s/$apachetime$zone2?/$1 /i ||
s/(^|[^a-z])$at\s*$D$mnsec$zone()/$1 /i ||
s/(^|[^a-z])$at\s*$D$mnsec$zone2?/$1 /i ||
s/(^|[^0-9])(\d)$mnsec$zone()/$1 /i ||
s/(^|[^0-9])(\d)$mnsec$zone2?/$1 /i ||
(s/(t)$D$mnsec$zone()/$1 /i and (($iso=-$tmp) || 1)) ||
(s/(t)$D$mnsec$zone2?/$1 /i and (($iso=-$tmp) || 1)) ||
(s/()$DD$mnsec$zone()/ /i and (($iso=$tmp) || 1)) ||
(s/()$DD$mnsec$zone2?/ /i and (($iso=$tmp) || 1)) ||
s/(^|$at\s*|\s+)$D()()\s*$ampmexp$zone()/ /i ||
s/(^|$at\s*|\s+)$D()()\s*$ampmexp$zone2?/ /i ||
0
) {
($h,$mn,$s,$ampm,$z,$z2)=($2,$3,$4,$5,$6,$7);
if (defined ($z)) {
if ($z =~ /^[+-]\d{2}:\d{2}$/) {
$z=~ s/://;
} elsif ($z =~ /^[+-]\d{2}$/) {
$z .= "00";
}
}
$time=1;
&Date_TimeCheck(\$h,\$mn,\$s,\$ampm);
$y=$m=$d="";
# We're going to be calling TimeCheck again below (when we check the
# final date), so get rid of $ampm so that we don't have an error
# due to "15:30:00 PM". It'll get reset below.
$ampm="";
if (/^\s*$/) {
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
last PARSE;
}
}
}
$time=0 if ($time ne "1");
s/\s+$//;
s/^\s+//;
# dateTtime ISO 8601 formats
my($orig)=$_;
s/t$//i if ($iso<0);
# Parse ISO 8601 dates now (which may still have a zone stuck to it).
if ( ($iso && /^([0-9-]+(?:W[0-9-]+)?)$zone?$/i) ||
($iso && /^([0-9-]+(?:W[0-9-]+)?)$zone2?$/i) ||
($iso && /^([0-9-]+(?:T[0-9-]+)?)$zone?$/i) ||
($iso && /^([0-9-]+(?:T[0-9-]+)?)$zone2?$/i) ||
0) {
# ISO 8601 dates
($_,$z,$z2) = ($1,$2);
s,-, ,g; # Change all ISO8601 seps to spaces
s/^\s+//;
s/\s+$//;
if (/^$D4\s*$DD\s*$DD\s*t?$DD(?:$DD(?:$DD(\d*))?)?$/i ||
/^$DD\s+$DD\s*$DD\s*t?$DD(?:$DD(?:$DD(\d*))?)?$/i ||
0
) {
# ISO 8601 Dates with times
# YYYYMMDDHHMNSSFFFF...
# YYYYMMDDHHMNSS
# YYYYMMDDHHMN
# YYYYMMDDHH
# YY MMDDHHMNSSFFFF...
# YY MMDDHHMNSS
# YY MMDDHHMN
# YY MMDDHH
($y,$m,$d,$h,$mn,$s,$tmp)=($1,$2,$3,$4,$5,$6,$7);
if ($h==24 && (! defined $mn || $mn==0) && (! defined $s || $s==0)) {
$h=0;
$midnight=1;
}
$z = "" if (! defined $h);
return "" if ($time && defined $h);
last PARSE;
} elsif (/^$D4(?:\s*$DD(?:\s*$DD)?)?$/ ||
/^$DD(?:\s+$DD(?:\s*$DD)?)?$/) {
# ISO 8601 Dates
# YYYYMMDD
# YYYYMM
# YYYY
# YY MMDD
# YY MM
# YY
($y,$m,$d)=($1,$2,$3);
last PARSE;
} elsif (/^$YY\s+$D\s+$D/) {
# YY-M-D
($y,$m,$d)=($1,$2,$3);
last PARSE;
} elsif (/^$YY\s*W$DD\s*(\d)?$/i) {
# YY-W##-D
($y,$wofm,$dofw)=($1,$2,$3);
($y,$m,$d)=&Date_NthWeekOfYear($y,$wofm,$dofw);
last PARSE;
} elsif (/^$D4\s*(\d{3})$/ ||
/^$DD\s*(\d{3})$/) {
# YYDOY
($y,$which)=($1,$2);
($y,$m,$d)=&Date_NthDayOfYear($y,$which);
last PARSE;
} elsif ($iso<0) {
# We confused something like 1999/August12:00:00
# with a dateTtime format
$_=$orig;
} else {
return "";
}
}
# All deltas that are not ISO-8601 dates are NOT dates.
return "" if ($Curr{"InCalc"} && $delta);
if ($delta) {
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
return &DateCalc_DateDelta($Curr{"Now"},$delta);
}
# Check for some special types of dates (next, prev)
foreach $from (keys %{ $Lang{$L}{"Repl"} }) {
$to=$Lang{$L}{"Repl"}{$from};
s/(^|[^a-z])$from($|[^a-z])/$1$to$2/i;
}
if (/$wom/i || /$future/i || /$later/i || /$past/i ||
/$next/i || /$prev/i || /^$week$/i || /$wkabb/i) {
$tmp=0;
if (/^$wom\s*$week$of\s*$month\s*$YY?$/i) {
# last friday in October 95
($wofm,$dofw,$m,$y)=($1,$2,$3,$4);
# fix $m, $y
return "" if (&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk));
$dofw=$week{lc($dofw)};
$wofm=$wom{lc($wofm)};
# Get the first day of the month
$date=&Date_Join($y,$m,1,$h,$mn,$s);
if ($wofm==-1) {
$date=&DateCalc_DateDelta($date,"+0:1:0:0:0:0:0",\$err,0);
$date=&Date_GetPrev($date,$dofw,0);
} else {
for ($i=0; $i<$wofm; $i++) {
if ($i==0) {
$date=&Date_GetNext($date,$dofw,1);
} else {
$date=&Date_GetNext($date,$dofw,0);
}
}
}
last PARSE;
} elsif (/^$last$day$of\s*$month(?:$of?\s*$YY)?/i) {
# last day in month
($m,$y)=($1,$2);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$y=&Date_FixYear($y) if (! defined $y or length($y)<4);
$m=$month{lc($m)};
$d=&Date_DaysInMonth($m,$y);
last PARSE;
} elsif (/^$week$/i) {
# friday
($dofw)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&Date_GetPrev($Curr{"Now"},$Cnf{"FirstDay"},1);
$date=&Date_GetNext($date,$dofw,1,$h,$mn,$s);
last PARSE;
} elsif (/^$next\s*$week$/i) {
# next friday
($dofw)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&Date_GetNext($Curr{"Now"},$dofw,0,$h,$mn,$s);
last PARSE;
} elsif (/^$prev\s*$week$/i) {
# last friday
($dofw)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&Date_GetPrev($Curr{"Now"},$dofw,0,$h,$mn,$s);
last PARSE;
} elsif (/^$next$wkabb$/i) {
# next week
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:0:1:0:0:0:0",\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$prev$wkabb$/i) {
# last week
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"-0:0:1:0:0:0:0",\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$next$mabb$/i) {
# next month
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:1:0:0:0:0:0",\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$prev$mabb$/i) {
# last month
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"-0:1:0:0:0:0:0",\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$future\s*(\d+)$day$/i ||
/^(\d+)$day$later$/i) {
# in 2 days
# 2 days later
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:0:0:$num:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^(\d+)$day$past$/i) {
# 2 days ago
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"-0:0:0:$num:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$future\s*(\d+)$wkabb$/i ||
/^(\d+)$wkabb$later$/i) {
# in 2 weeks
# 2 weeks later
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:0:$num:0:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^(\d+)$wkabb$past$/i) {
# 2 weeks ago
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"-0:0:$num:0:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$future\s*(\d+)$mabb$/i ||
/^(\d+)$mabb$later$/i) {
# in 2 months
# 2 months later
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:$num:0:0:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^(\d+)$mabb$past$/i) {
# 2 months ago
($num)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"-0:$num:0:0:0:0:0",
\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$week$future\s*(\d+)$wkabb$/i ||
/^$week\s*(\d+)$wkabb$later$/i) {
# friday in 2 weeks
# friday 2 weeks later
($dofw,$num)=($1,$2);
$tmp="+";
} elsif (/^$week\s*(\d+)$wkabb$past$/i) {
# friday 2 weeks ago
($dofw,$num)=($1,$2);
$tmp="-";
} elsif (/^$future\s*(\d+)$wkabb$on$week$/i ||
/^(\d+)$wkabb$later$on$week$/i) {
# in 2 weeks on friday
# 2 weeks later on friday
($num,$dofw)=($1,$2);
$tmp="+"
} elsif (/^(\d+)$wkabb$past$on$week$/i) {
# 2 weeks ago on friday
($num,$dofw)=($1,$2);
$tmp="-";
} elsif (/^$week\s*$wkabb$/i) {
# monday week (British date: in 1 week on monday)
$dofw=$1;
$num=1;
$tmp="+";
} elsif (/^$now\s*$wkabb$/i) {
# today week (British date: 1 week from today)
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},"+0:0:1:0:0:0:0",\$err,0);
$date=&Date_SetTime($date,$h,$mn,$s) if (defined $h);
last PARSE;
} elsif (/^$offset\s*$wkabb$/i) {
# tomorrow week (British date: 1 week from tomorrow)
($offset)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$offset=$Lang{$L}{"OffsetH"}{lc($offset)};
$date=&DateCalc_DateDelta($Curr{"Now"},$offset,\$err,0);
$date=&DateCalc_DateDelta($date,"+0:0:1:0:0:0:0",\$err,0);
if ($time) {
return ""
if (&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk));
$date=&Date_SetTime($date,$h,$mn,$s);
}
last PARSE;
}
if ($tmp) {
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=&DateCalc_DateDelta($Curr{"Now"},
$tmp . "0:0:$num:0:0:0:0",\$err,0);
$date=&Date_GetPrev($date,$Cnf{"FirstDay"},1);
$date=&Date_GetNext($date,$dofw,1,$h,$mn,$s);
last PARSE;
}
}
# Change (2nd, second) to 2
$tmp=0;
if (/(^|[^a-z0-9])$dom($|[^a-z0-9])/i) {
if (/^\s*$dom\s*$/) {
($d)=($1);
$d=$dom{lc($d)};
$m=$Curr{"M"};
last PARSE;
}
my $from = $2;
my $to = $dom{ lc($from) };
s/(^|[^a-z])$from($|[^a-z])/$1 $to $2/i;
s/^\s+//;
s/\s+$//;
}
# Another set of special dates (Nth week)
if (/^$D\s*$week(?:$of?\s*$YY)?$/i) {
# 22nd sunday in 1996
($which,$dofw,$y)=($1,$2,$3);
$y=$Curr{"Y"} if (! $y);
$y--; # previous year
$tmp=&Date_GetNext("$y-12-31",$dofw,0);
if ($which>1) {
$tmp=&DateCalc_DateDelta($tmp,"+0:0:".($which-1).":0:0:0:0",\$err,0);
}
($y,$m,$d)=(&Date_Split($tmp, 1))[0..2];
last PARSE;
} elsif (/^$week$wkabb\s*$D(?:$of?\s*$YY)?$/i ||
/^$week\s*$D$wkabb(?:$of?\s*$YY)?$/i) {
# sunday week 22 in 1996
# sunday 22nd week in 1996
($dofw,$which,$y)=($1,$2,$3);
($y,$m,$d)=&Date_NthWeekOfYear($y,$which,$dofw);
last PARSE;
}
# Get rid of day of week
if (/(^|[^a-z])$week($|[^a-z])/i) {
$wk=$2;
(s/(^|[^a-z])$week,/$1 /i) ||
s/(^|[^a-z])$week($|[^a-z])/$1 $3/i;
s/^\s+//;
s/\s+$//;
}
{
# So that we can handle negative epoch times, let's convert
# things like "epoch -" to "epochNEGATIVE " before we strip out
# the $sep chars, which include '-'.
s,epoch\s*-,epochNEGATIVE ,g;
# Non-ISO8601 dates
s,\s*$sep\s*, ,g; # change all non-ISO8601 seps to spaces
s,^\s*,,; # remove leading/trailing space
s,\s*$,,;
if (/^$D\s+$D(?:\s+$YY)?$/) {
# MM DD YY (DD MM YY non-US)
($m,$d,$y)=($1,$2,$3);
($m,$d)=($d,$m) if ($type ne "US");
last PARSE;
} elsif (/^$D4\s*$D\s*$D$/) {
# YYYY MM DD
($y,$m,$d)=($1,$2,$3);
last PARSE;
} elsif (s/(^|[^a-z])$month($|[^a-z])/$1 $3/i) {
($m)=($2);
if (/^\s*$D(?:\s+$YY)?\s*$/) {
# mmm DD YY
# DD mmm YY
# DD YY mmm
($d,$y)=($1,$2);
last PARSE;
} elsif (/^\s*$D$D4\s*$/) {
# mmm DD YYYY
# DD mmm YYYY
# DD YYYY mmm
($d,$y)=($1,$2);
last PARSE;
} elsif (/^\s*$D4\s*$D\s*$/) {
# mmm YYYY DD
# YYYY mmm DD
# YYYY DD mmm
($y,$d)=($1,$2);
last PARSE;
} elsif (/^\s*$D4\s*$/) {
# mmm YYYY
# YYYY mmm
($y,$d)=($1,1);
last PARSE;
} else {
return "";
}
} elsif (/^epochNEGATIVE (\d+)$/) {
$s=$1;
$date=&DateCalc("1970-01-01 00:00 GMT","-0:0:$s");
} elsif (/^epoch\s*(\d+)$/i) {
$s=$1;
$date=&DateCalc("1970-01-01 00:00 GMT","+0:0:$s");
} elsif (/^$now$/i) {
# now, today
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$date=$Curr{"Now"};
if ($time) {
return ""
if (&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk));
$date=&Date_SetTime($date,$h,$mn,$s);
}
last PARSE;
} elsif (/^$offset$/i) {
# yesterday, tomorrow
($offset)=($1);
&Date_Init() if (! $Cnf{"UpdateCurrTZ"});
$offset=$Lang{$L}{"OffsetH"}{lc($offset)};
$date=&DateCalc_DateDelta($Curr{"Now"},$offset,\$err,0);
if ($time) {
return ""
if (&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk));
$date=&Date_SetTime($date,$h,$mn,$s);
}
last PARSE;
} else {
return "";
}
}
}
if (! $date) {
return "" if (&Date_DateCheck(\$y,\$m,\$d,\$h,\$mn,\$s,\$ampm,\$wk));
$date=&Date_Join($y,$m,$d,$h,$mn,$s);
}
$date=&Date_ConvTZ($date,$z);
if ($midnight) {
$date=&DateCalc_DateDelta($date,"+0:0:0:1:0:0:0");
}
return $date;
}
sub ParseDate {
print "DEBUG: ParseDate\n" if ($Curr{"Debug"} =~ /trace/);
&Date_Init() if (! $Curr{"InitDone"});
my($args,@args,@a,$ref,$date)=();
@a=@_;
# @a : is the list of args to ParseDate. Currently, only one argument
# is allowed and it must be a scalar (or a reference to a scalar)
# or a reference to an array.
if ($#a!=0) {
print "ERROR: Invalid number of arguments to ParseDate.\n";
return "";
}
$args=$a[0];
$ref=ref $args;
if (! $ref) {
return $args if (&Date_Split($args));
@args=($args);
} elsif ($ref eq "ARRAY") {
@args=@$args;
} elsif ($ref eq "SCALAR") {
return $$args if (&Date_Split($$args));
@args=($$args);
} else {
print "ERROR: Invalid arguments to ParseDate.\n";
return "";
}
@a=@args;
# @args : a list containing all the arguments (dereferenced if appropriate)
# @a : a list containing all the arguments currently being examined
# $ref : nil, "SCALAR", or "ARRAY" depending on whether a scalar, a
# reference to a scalar, or a reference to an array was passed in
# $args : the scalar or refererence passed in
PARSE: while($#a>=0) {
$date=join(" ",@a);
$date=&ParseDateString($date);
last if ($date);
pop(@a);
} # PARSE
splice(@args,0,$#a + 1);
@$args= @args if (defined $ref and $ref eq "ARRAY");
$date;
}
sub Date_Cmp {
my($D1,$D2)=@_;
my($date1)=&ParseDateString($D1);
my($date2)=&ParseDateString($D2);
return $date1 cmp $date2;
}
# **NOTE**
# The calc routines all call parse routines, so it is never necessary to
# call Date_Init in the calc routines.
sub DateCalc {
print "DEBUG: DateCalc\n" if ($Curr{"Debug"} =~ /trace/);
my($D1,$D2,@arg)=@_;
my($ref,$err,$errref,$mode)=();
$errref=shift(@arg);
$ref=0;
if (defined $errref) {
if (ref $errref) {
$mode=shift(@arg);
$ref=1;
} else {
$mode=$errref;
$errref="";
}
}
my(@date,@delta,$ret,$tmp,$old)=();
if (defined $mode and $mode>=0 and $mode<=3) {
$Curr{"Mode"}=$mode;
} else {
$Curr{"Mode"}=0;
}
$old=$Curr{"InCalc"};
$Curr{"InCalc"}=1;
if ($tmp=&ParseDateString($D1)) {
# If we've already parsed the date, we don't want to do it a second
# time (so we don't convert timezones twice).
if (&Date_Split($D1)) {
push(@date,$D1);
} else {
push(@date,$tmp);
}
} elsif ($tmp=&ParseDateDelta($D1)) {
push(@delta,$tmp);
} else {
$$errref=1 if ($ref);
return;
}
if ($tmp=&ParseDateString($D2)) {
if (&Date_Split($D2)) {
push(@date,$D2);
} else {
push(@date,$tmp);
}
} elsif ($tmp=&ParseDateDelta($D2)) {
push(@delta,$tmp);
} else {
$$errref=2 if ($ref);
return;
}
$mode=$Curr{"Mode"};
$Curr{"InCalc"}=$old;
if ($#date==1) {
$ret=&DateCalc_DateDate(@date,$mode);
} elsif ($#date==0) {
$ret=&DateCalc_DateDelta(@date,@delta,\$err,$mode);
$$errref=$err if ($ref);
} else {
$ret=&DateCalc_DeltaDelta(@delta,$mode);
}
$ret;
}
sub ParseDateDelta {
print "DEBUG: ParseDateDelta\n" if ($Curr{"Debug"} =~ /trace/);
my($args,@args,@a,$ref)=();
local($_)=();
@a=@_;
# @a : is the list of args to ParseDateDelta. Currently, only one argument
# is allowed and it must be a scalar (or a reference to a scalar)
# or a reference to an array.
if ($#a!=0) {
print "ERROR: Invalid number of arguments to ParseDateDelta.\n";
return "";
}
$args=$a[0];
$ref=ref $args;
if (! $ref) {
@args=($args);
} elsif ($ref eq "ARRAY") {
@args=@$args;
} elsif ($ref eq "SCALAR") {
@args=($$args);
} else {
print "ERROR: Invalid arguments to ParseDateDelta.\n";
return "";
}
@a=@args;
# @args : a list containing all the arguments (dereferenced if appropriate)
# @a : a list containing all the arguments currently being examined
# $ref : nil, "SCALAR", or "ARRAY" depending on whether a scalar, a
# reference to a scalar, or a reference to an array was passed in
# $args : the scalar or refererence passed in
my(@colon,@delta,$delta,$dir,$colon,$sign,$val)=();
my($len,$tmp,$tmp2,$tmpl)=();
my($from,$to)=();
my($workweek)=$Cnf{"WorkWeekEnd"}-$Cnf{"WorkWeekBeg"}+1;
&Date_Init() if (! $Curr{"InitDone"});
# A sign can be a sequence of zero or more + and - signs, this
# allows for deltas like '+ -2 days'.
my($signexp)='((?:[+-]\s*)*)';
my($numexp)='(\d+)';
my($exp1)="(?: \\s* $signexp \\s* $numexp \\s*)";
my($yexp,$mexp,$wexp,$dexp,$hexp,$mnexp,$sexp,$i)=();
$yexp=$mexp=$wexp