S
S
Senseich2018-01-30 04:23:41
1C-Bitrix
Senseich, 2018-01-30 04:23:41

Why is the date converted to English by Bitrix?

I need to convert the date that I get from the property (date)
From this view 10/07/2017 to this - November 07 2017
I do this:

<?
$datetime = $arItem["PROPERTIES"]["DATE"]["VALUE"];            
echo ConvertDateTime("$datetime", "YYYY-MMMM-DD", "ru");
?>

But all the time in English 2017-November-07, why is that. How is it done correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Mifle, 2018-01-30
@OlegMifle

Why are you passing $detime in quotes? Don't need it.
The 3rd parameter should be the site ID. Do you have it "ru"? If yes, see what is the default language for this site.

M
MrYupi, 2020-11-27
@MrYupi

They have already answered in the comments, but I will duplicate it, because I had to figure it out myself (I didn’t get into the comments).
It is necessary to use FormatDate (Mb there is something newer), there are language files with the names of months, days of the week. Playing with locales won't change anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question