Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change default date language?
#8
(2014-10-30, 03:31:37)none20 Wrote:
Code:
<?php get_page_date(); ?>

You can do it with strftime function. If you change your snippet to this:
Code:
<?php echo strftime("%A, %e %B, %Y",get_page_date('U',false)); ?>

you will get the date according to the PHP locale set in gsconfig.php.

For example:
en_GB: Wednesday, 29 October, 2014
fr_FR: mercredi, 29 octobre, 2014

get_page_date('U',false) returns (instead of echo) the date in Unix epoch format, which is then changed to the locale-specific format by strftime.

See the PHP manual for strftime for all the formatting options.
--
Nick.
Reply


Messages In This Thread
How to change default date language? - by none20 - 2014-10-30, 03:31:37
RE: How to change default date language? - by hameau - 2014-10-30, 06:20:35



Users browsing this thread: 2 Guest(s)