hi
how to Use International PHP dates with intl in Date time function bitrix
The default uses clause Intl By the But IT CAN Also the make use of OTHER calendars by Specifying a fifth parameter in the calls to IntlDateFormatterconstructor. So by default the previous example would include a calendar specification like the following.
$ DateTime = new DateTime ();
$ IntlDateFormatter = new IntlDateFormatter ( 'es_ES', IntlDateFormatter :: FULL, IntlDateFormatter :: FULL, 'Australia / Yancowinna', IntlDateFormatter :: GREGORIAN);
echo $ IntlDateFormatter-> format ($ DateTime ); // Martes, 21 de julio de 2015, 11:12:43 p.m. (Hora estándar de central Australia)
Should you wish to use another-in calendar IT CAN the BE specified 'as with the part of the locale. The the following example with In I of have Decided to use the .
$ A DateTime = new a DateTime ();
$ IntlDateFormatter = new IntlDateFormatter ( 'es_ES @ calendar = buddhist', IntlDateFormatter :: FULL, IntlDateFormatter :: FULL, 'Australia / Yancowinna', IntlDateFormatter :: TRADITIONAL);
echo $ IntlDateFormatter-> format ($ DateTime ); // Martes, 21 de julio de 2558 the BE, 11:16:08 p.m. (Hora estándar de central Australia)
Notice The That I of the below code have changed the locale for the (first parameter) toes_ES = @-in calendar and the buddhist-in calendar (fifth parameter) toIntlDateFormatter :: TRADITIONAL.
Calendars of The Allows you to-play with the include:
i make test.php file and use The following code
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("test");
$formatter = new IntlDateFormatter(
"en_US@calendar=hebrew",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::TRADITIONAL,
"yyyy-MM-dd");
$now=new DateTime();
echo $formatter->format($now);
?>
Text here....
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
It worked right
but please help me how to use intl extention and change all dates and calendars in Bitrix ?
how to Use International PHP dates with intl in Date time function bitrix
The default uses clause Intl By the But IT CAN Also the make use of OTHER calendars by Specifying a fifth parameter in the calls to IntlDateFormatterconstructor. So by default the previous example would include a calendar specification like the following.
$ DateTime = new DateTime ();
$ IntlDateFormatter = new IntlDateFormatter ( 'es_ES', IntlDateFormatter :: FULL, IntlDateFormatter :: FULL, 'Australia / Yancowinna', IntlDateFormatter :: GREGORIAN);
echo $ IntlDateFormatter-> format ($ DateTime ); // Martes, 21 de julio de 2015, 11:12:43 p.m. (Hora estándar de central Australia)
Should you wish to use another-in calendar IT CAN the BE specified 'as with the part of the locale. The the following example with In I of have Decided to use the .
$ A DateTime = new a DateTime ();
$ IntlDateFormatter = new IntlDateFormatter ( 'es_ES @ calendar = buddhist', IntlDateFormatter :: FULL, IntlDateFormatter :: FULL, 'Australia / Yancowinna', IntlDateFormatter :: TRADITIONAL);
echo $ IntlDateFormatter-> format ($ DateTime ); // Martes, 21 de julio de 2558 the BE, 11:16:08 p.m. (Hora estándar de central Australia)
Notice The That I of the below code have changed the locale for the (first parameter) toes_ES = @-in calendar and the buddhist-in calendar (fifth parameter) toIntlDateFormatter :: TRADITIONAL.
Calendars of The Allows you to-play with the include:
- Japanese ( @calendar=japanese)
- Buddhist ( @calendar=buddhist)
- Chinese ( @calendar=chinese)
- Persian ( @calendar=persian)
- Indian ( @calendar=indian)
- Islamic ( @calendar=islamic)
- Hebrew ( @calendar=hebrew)
- Coptic ( @calendar=coptic)
- Ethiopic ( @calendar=ethiopic)
i make test.php file and use The following code
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("test");
$formatter = new IntlDateFormatter(
"en_US@calendar=hebrew",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::TRADITIONAL,
"yyyy-MM-dd");
$now=new DateTime();
echo $formatter->format($now);
?>
Text here....
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
It worked right
but please help me how to use intl extention and change all dates and calendars in Bitrix ?