[plug] Command to find out a particular date occurence

Simon Newton newtons at iinet.net
Tue Jan 14 22:43:05 WST 2003


#!/usr/bin/perl
use Date::Manip;$f=\&ParseRecur;
map{$d=$_;map{print $_.$/ if $d eq $_}&$f('every 1st friday in '.substr
$d,0,4)}&$f('*1900-2000:1:0:21:0:0:0')

Simon N

On Tue, 2003-01-14 at 20:58, Jeremy Malcolm wrote:
> On Tue, 14 Jan 2003 08:50:07 +0000 (UTC)
> brad at mapsolutions.com.au (Brad Browne) wrote:
> 
> > In this spirit of the units utility, is there a calendar utility that
> > will allow me to type the date, like Jan 21 Fri or similar, and it
> > will tell me what year it will fall in ?  BTW, after Leon hit the list
> > with a description of units I have been using it ever since, so kudos
> > to you Leon !!
> 
> #!/usr/bin/perl
> use Date::Manip;
> @dates1 = &ParseRecur("*1900-2000:1:0:21:0:0:0");
> foreach $date1( @dates1 ) {
>   $year = substr $date1,0,4;
>   @dates2 = &ParseRecur("every 1st friday in $year");
>   foreach $date2 ( @dates2 ) {
>     if ( $date1 eq $date2 ) {
>       print "$date2\n"
>     }
>   }
> }
> 
> -- 
> JEREMY MALCOLM <Jeremy at Malcolm.id.au> Personal: http://www.malcolm.id.au
> Providing online networks of Australian lawyers (http://www.ilaw.com.au)
> and Linux experts (http://www.linuxconsultants.com.au) for instant help!
> Disclaimer: http://www.terminus.net.au/disclaimer.html. GPG key: finger.
> 
> 




More information about the plug mailing list