Skip to content

Allow arbitrary method output in CLDR formats #38

@autarch

Description

@autarch

Migrated from rt.cpan.org #49767 (status was 'stalled')

Requestors:

From dmuey@cpan.org on 2009-09-16 18:42:33:

Hello again,

Last one I promise :)

Just FYI: I am filing this rt under DateTime::Locale instead DateTime
since ::Locale specifies formats, let me know if I should re-file under
DateTime (or if this simply won't be implemented), thanks.

strftime() has %s for 'The number of seconds since the epoch.'

Also it supported %{epoch} to have it call the DT method "epoch".

I can't seem to find an equivalent way to do 'The number of seconds
since the epoch.' with format_cldr()

$ perl -MDateTime -le 'print DateTime->now()->strftime("%B %{day}, %Y
%{hour_12}:%M:%S %p %{time_zone_long_name} == %s");'
September 16, 2009 6:24:23 PM UTC == 1253125463

$ perl -MDateTime -le 'print DateTime->now()->strftime("%B %{day}, %Y
%{hour_12}:%M:%S %p %{time_zone_long_name} == %{epoch}");'
September 16, 2009 6:24:33 PM UTC == 1253125473

$ perl -MDateTime -le 'print DateTime->now()->format_cldr("MMMM d, y
h:mm:ss a z == ???");'
September 16, 2009 6:24:40 PM UTC == ???

Is a CLDR %s equivalent currently available and I just missed it? (If so
what did I miss?)

If not: how [im]possible/[un]likley is it to be added?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions