Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change default date language?
#12
(2014-10-30, 06:20:35)hameau Wrote:
(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.


Yes !!! it works !!! You're amazing !!!
Simple easy - best : - )
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 none20 - 2014-10-30, 20:18:28



Users browsing this thread: 1 Guest(s)