develooper Front page | perl.datetime | Postings from February 2021

Surprising results from predefined CLDR formats

Thread Next
February 24, 2021 05:26
Surprising results from predefined CLDR formats
Message ID:
Please consider this code:

use DateTime;

my $dt = DateTime->now( locale => 'sv' );

for my $fmt ( $dt->locale->available_formats ) {
  my $val = $dt->format_cldr($fmt);
  say "$fmt : $val";

Most of the formatted strings seem to be missing some whitespace and have
things in a surprisising order.
E.g. `MMMd` gives `feb.23` where I would have expected `23 feb.`.

I don't know if/what I'm doing wrong, or whether this is a DateTime,
DateTime::Locale or CLDR bug or indeed if it is a bug at all.

Better --help|less than helpless

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About