Acme-CPANModules-FormattingDate
view release on metacpan or search on metacpan
You can actually add some modifiers for the conversions to set
width/zero-padding/alignment, like you can do with sprintf (e.g. %03d
supposing you want 3-digit day of month numbers). But this feature is
platform-dependent.
yyyy-mm-dd template
This "yyyy-mm-dd" (for lack of a better term) format is much more
commonly used in the general computing world, from spreadsheets to
desktop environment clocks. And this format is probably older than
strftime. The template is more intuitive to use for people as it gives a
clear picture of how wide each component (and the whole string) will be.
There are some modules you can use to format dates using this style.
First of all there's Date::Formatter. I find its API a little bit
annoying, from the verbose date component key names and inconsistent
usage of plurals, to having to use a separate method to "create the
formatter" first.
PHP
lib/Acme/CPANModules/FormattingDate.pm view on Meta::CPAN
<pm:Date::strftimeq> which provides an extension to this.
You can actually add some modifiers for the conversions to set
width/zero-padding/alignment, like you can do with sprintf (e.g. `%03d`
supposing you want 3-digit day of month numbers). But this feature is
platform-dependent.
**yyyy-mm-dd template**
This "yyyy-mm-dd" (for lack of a better term) format is much more commonly used
in the general computing world, from spreadsheets to desktop environment clocks.
And this format is probably older than strftime. The template is more intuitive
to use for people as it gives a clear picture of how wide each component (and
the whole string) will be.
There are some modules you can use to format dates using this style. First of
all there's <pm:Date::Formatter>. I find its API a little bit annoying, from the
verbose date component key names and inconsistent usage of plurals, to having to
use a separate method to "create the formatter" first.
**PHP**
lib/Acme/CPANModules/FormattingDate.pm view on Meta::CPAN
L<Date::strftimeq> which provides an extension to this.
You can actually add some modifiers for the conversions to set
width/zero-padding/alignment, like you can do with sprintf (e.g. C<%03d>
supposing you want 3-digit day of month numbers). But this feature is
platform-dependent.
B<yyyy-mm-dd template>
This "yyyy-mm-dd" (for lack of a better term) format is much more commonly used
in the general computing world, from spreadsheets to desktop environment clocks.
And this format is probably older than strftime. The template is more intuitive
to use for people as it gives a clear picture of how wide each component (and
the whole string) will be.
There are some modules you can use to format dates using this style. First of
all there's L<Date::Formatter>. I find its API a little bit annoying, from the
verbose date component key names and inconsistent usage of plurals, to having to
use a separate method to "create the formatter" first.
B<PHP>
( run in 0.303 second using v1.01-cache-2.11-cpan-299005ec8e3 )