in reply to Re: strptime("%Y-%m") in perl6
in thread strptime("%Y-%m") in perl6
I don't care about date parsing, I don't look at string at all -- perl5 does that for me.use Time::Piece; localtime()->strptime(@ARGV[0], "%Y-%m");
What is elegant way to do thatn in perl6?bash$ perl -e 'use Time::Piece; localtime()->strptime(@ARGV[0], "%Y +-%m"); print "ok\n"; ' "2019-01" ok bash$ perl -e 'use Time::Piece; localtime()->strptime(@ARGV[0], "%Y +-%m"); print "ok\n"; ' "2019-77" Error parsing time at /usr/lib/x86_64-linux-gnu/perl/5.26/Time/Piece.p +m line 481.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: strptime("%Y-%m") in perl6
by choroba (Cardinal) on Feb 05, 2019 at 14:55 UTC | |
|
Re^3: strptime("%Y-%m") in perl6
by Laurent_R (Canon) on Feb 05, 2019 at 17:04 UTC | |
by leszekdubiel (Scribe) on Feb 05, 2019 at 17:34 UTC | |
by Laurent_R (Canon) on Feb 05, 2019 at 20:17 UTC |