Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/sender/lib/internals/ |
Upload File : |
<?php /** * Bitrix Framework * @package bitrix * @subpackage sender * @copyright 2001-2012 Bitrix */ namespace Bitrix\Sender\Internals; use Bitrix\Main\Localization\Loc; use Bitrix\Main\Application; use Bitrix\Main\Type\Date; use Bitrix\Main\Type\DateTime; Loc::loadMessages(__FILE__); /** * Class PrettyDate * @package Bitrix\Sender\Internals */ class PrettyDate { /** * Get datetime format. * * @return string */ public static function getDateTimeFormat() { $isAmPm = IsAmPmMode(true); switch ($isAmPm) { case AM_PM_LOWER: return Loc::getMessage('SENDER_PRETTY_DATE_FORMAT_DATETIME_PM_LOWER'); case AM_PM_UPPER: return Loc::getMessage('SENDER_PRETTY_DATE_FORMAT_DATETIME_PM_UPPER'); } return Loc::getMessage('SENDER_PRETTY_DATE_FORMAT_DATETIME'); } /** * Get date format. * * @return string */ public static function getDateFormat() { return Loc::getMessage('SENDER_PRETTY_DATE_FORMAT_DATE'); } /** * Format datetime. * * @param DateTime|null $date Date. * @return string */ public static function formatDateTime(DateTime $date = null) { $date = $date ?: new DateTime(); return \FormatDate(self::getDateTimeFormat(), MakeTimeStamp($date)); } /** * Format date. * * @param Date|null $date Date. * @return string */ public static function formatDate(Date $date = null) { $date = $date ?: new Date(); return \FormatDate(self::getDateFormat(), DateTime::createFromTimestamp(MakeTimeStamp($date))); } }