You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
Also it supported %{epoch} to have it call the DT method "epoch".
I think supporting something like this in the CLDR output would be nice
but I haven't come up with anything that I think fits in with the CLDR
style. If you have any ideas please send them to datetime@perl.org.
I've looked at this several times over the years and I've come to the
conclusion that there's no good way to do this. CLDR just uses random
letters as formats, so there's no good way to allow method names in the
format.
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?
The text was updated successfully, but these errors were encountered: