S
S
siroper2022-01-12 02:37:26
PHP
siroper, 2022-01-12 02:37:26

How to fix different php-smarty date output on different hosts?

Used by Smarty 3 + php.
On jino.ru (php 5.6) hosting, if you display the date in this format: {$smarty.now|date_format:"%B %Y"|lower}- the result will be January 2022 .

On beget.com hosting, ISP Manager was installed on the VPS, the same version of PHP 5.6 was installed, timezone Europe/Moscow was set up, january 2022 is displayed .
Solved this problem by way setlocale(LC_ALL, 'ru_RU.utf8');in PHP.

But now it is not January 2022 that is displayed as on jino, but January 2022 (that is, as if we display the date with a number, but we only display the month and year .....) Tell me how to treat ? The script is self-written, the output of dates is very, very, very much where it is located, changing everywhere is not an option, you need to somehow universally solve the problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
siroper, 2022-01-12
@siroper

It turned out that on these server settings %Byou need to write instead %OBto get the desired result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question