in reply to Calendar library - appointment recurrance
Hello jasonwolf,
I personaly prefer Date::Manip.
Sample of code:
#!/usr/bin/perl use strict; use warnings; use Date::Manip; use Data::Dumper; # Y M W D H M S base''start''end' my @dates = ParseRecur("0:1:0:0:0:0:0","","today", "Jan 1 2019"); # my @dates = ParseRecur("0:1:0:0:0:0:0","","today", "01/01/2019"); # my @dates = ParseRecur("0:1:0:0:0:0:0","","today", "1st January 2019 +"); # my @dates = ParseRecur("0:1:0:0:0:0:0","","today", "First of January + 2019"); my @datesFormatted = map { UnixDate($_, '%Y-%m-%d') } @dates; print Dumper \@datesFormatted; __END__ $ perl test.pl $VAR1 = [ '2018-01-24', '2018-02-24', '2018-03-24', '2018-04-24', '2018-05-24', '2018-06-24', '2018-07-24', '2018-08-24', '2018-09-24', '2018-10-24', '2018-11-24', '2018-12-24' ];
Update: Adding a few more different string inputs on the end date format.
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calendar library - appointment recurrance
by jasonwolf (Sexton) on Jan 24, 2018 at 18:36 UTC |