mirror of
https://github.com/imapsync/imapsync.git
synced 2024-11-17 00:02:29 +01:00
27 lines
692 B
Plaintext
27 lines
692 B
Plaintext
|
#!/usr/bin/perl -w
|
||
|
|
||
|
|
||
|
require Date::Manip;
|
||
|
|
||
|
Date::Manip->import(qw(ParseDate Date_Cmp UnixDate));
|
||
|
|
||
|
foreach $date_inp ("21-Jan-2004 23:10:58 +0200", "21-Feb-2004 0:14:02 +0200",
|
||
|
"15-Oct-2004 23:25:42 +0200", "19-Aug-2005 1:49:08 +0200") {
|
||
|
$date_dm = ParseDate($date_inp);
|
||
|
$date_un = UnixDate($date_dm, "%g");
|
||
|
unless ($date_dm) {
|
||
|
print "Error in date [$date_inp]\n";
|
||
|
next;
|
||
|
}
|
||
|
print " $date_inp\n$date_un\n";
|
||
|
|
||
|
}
|
||
|
|
||
|
$date1 = ParseDate("21-Feb-2004 0:14:02 +0200");
|
||
|
$date2 = ParseDate("21-Feb-2004 00:14:02 +0200");
|
||
|
|
||
|
print "cmp date1 $date1 date2 $date2 : ", Date_Cmp($date1,$date2), "\n";
|
||
|
|
||
|
print "UnixDate ", UnixDate($date1, "%g"), "\n";
|
||
|
print "UnixDate ", UnixDate(undef, "%g"), "\n";
|