当前位置: 首页>>代码示例>>PHP>>正文


PHP DateTime::toString方法代码示例

本文整理汇总了PHP中Bitrix\Main\Type\DateTime::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTime::toString方法的具体用法?PHP DateTime::toString怎么用?PHP DateTime::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Main\Type\DateTime的用法示例。


在下文中一共展示了DateTime::toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertation

 /**
  * Convertation property for creation agent in queue through the old and dirty Bitrix API.
  */
 protected function convertation()
 {
     if ($this->executionTime instanceof DateTime) {
         $this->executionTime = $this->executionTime->toString();
     } elseif ($this->executionTime === null) {
         $time = new DateTime();
         $this->executionTime = $time->toString();
     }
     foreach (['periodically', 'active'] as $property) {
         if ($this->{$property} === true) {
             $this->{$property} = 'Y';
         } else {
             $this->{$property} = 'N';
         }
     }
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:19,代码来源:AgentTask.php

示例2: implode

        if (ApplicationPasswordTable::getRow(array("filter" => array("=ID" => $id, "=USER_ID" => $USER->GetID()))) !== null) {
            $result = ApplicationPasswordTable::delete($id);
            if ($result->isSuccess()) {
                $answer["success"] = true;
                $answer["message"] = Loc::getMessage("main_app_passwords_ajax_deleted");
            } else {
                $answer["message"] = implode("<br>", $result->getErrorMessages());
            }
        }
    } elseif ($post["action"] == "add") {
        //adding a new application password
        $appManager = ApplicationManager::getInstance();
        $applications = $appManager->getApplications();
        $password = ApplicationPasswordTable::generatePassword();
        if (isset($applications[$post['APPLICATION_ID']])) {
            $date = new Main\Type\DateTime();
            $result = ApplicationPasswordTable::add(array('USER_ID' => $USER->GetID(), 'APPLICATION_ID' => $post['APPLICATION_ID'], 'PASSWORD' => $password, 'DATE_CREATE' => $date, 'COMMENT' => $post['COMMENT'], 'SYSCOMMENT' => $post['SYSCOMMENT']));
            if ($result->isSuccess()) {
                $answer["success"] = true;
                $answer["id"] = $result->getId();
                $answer["date_create"] = $date->toString();
                $answer["password"] = '<span>' . implode(str_split($password, 4), '</span><span>') . '</span>';
            } else {
                $answer["message"] = implode("<br>", $result->getErrorMessages());
            }
        } else {
            $answer["message"] = Loc::getMessage("main_app_passwords_ajax_no_app");
        }
    }
}
echo Json::encode($answer);
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:ajax.php


注:本文中的Bitrix\Main\Type\DateTime::toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。