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


PHP DateHelper::formatDateTimeFromCustomToNormal方法代码示例

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


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

示例1: ini

 public function ini()
 {
     $date1 = date(NORMALDATEFORMAT);
     $date1test = DateHelper::formatDateFromNormalToDatabase($date1);
     $this->setVars("pureDate1", $date1);
     $this->setVars("formattedDate1", $date1test);
     $date2 = date(DATABASEDATEFORMAT);
     $date2test = DateHelper::formatDateFromDatabaseToNormal($date2);
     $this->setVars("pureDate2", $date2);
     $this->setVars("formattedDate2", $date2test);
     $date3 = date(NORMALDATEFORMAT);
     $date3test = DateHelper::formatDateFromNormalToCustom('d#m#Y', $date3);
     $this->setVars("pureDate3", $date3);
     $this->setVars("formattedDate3", $date3test);
     $date4 = date('d#m#Y');
     $date4test = DateHelper::formatDateFromCustomToNormal('d#m#Y', $date4);
     $this->setVars("pureDate4", $date4);
     $this->setVars("formattedDate4", $date4test);
     $time1 = date(NORMALTIMEFORMAT);
     $time1test = DateHelper::formatTimeFromNormalToDatabase($time1);
     $this->setVars("pureTime1", $time1);
     $this->setVars("formattedTime1", $time1test);
     $time2 = date(DATABASETIMEFORMAT);
     $time2test = DateHelper::formatTimeFromDatabaseToNormal($time2);
     $this->setVars("pureTime2", $time2);
     $this->setVars("formattedTime2", $time2test);
     $time3 = date(NORMALTIMEFORMAT);
     $time3test = DateHelper::formatTimeFromNormalToCustom("H#i#s", $time3);
     $this->setVars("pureTime3", $time3);
     $this->setVars("formattedTime3", $time3test);
     $time4 = date('H#i#s');
     $time4test = DateHelper::formatTimeFromCustomToNormal("H#i#s", $time4);
     $this->setVars("pureTime4", $time4);
     $this->setVars("formattedTime4", $time4test);
     $dateTime1 = date(NORMALDATETIMEFORMAT);
     $dateTime1test = DateHelper::formatDateTimeFromNormalToDatabase($dateTime1);
     $this->setVars("pureDateTime1", $dateTime1);
     $this->setVars("formattedDateTime1", $dateTime1test);
     $dateTime2 = date(DATABASEDATETIMEFORMAT);
     $dateTime2test = DateHelper::formatDateTimeFromDatabaseToNormal($dateTime2);
     $this->setVars("pureDateTime2", $dateTime2);
     $this->setVars("formattedDateTime2", $dateTime2test);
     $dateTime3 = date(NORMALDATETIMEFORMAT);
     $dateTime3test = DateHelper::formatDateTimeFromNormalToCustom("d#m#Y H#i#s", $dateTime3);
     $this->setVars("pureDateTime3", $dateTime3);
     $this->setVars("formattedDateTime3", $dateTime3test);
     $dateTime4 = date('d#m#Y H#i#s');
     $dateTime4test = DateHelper::formatDateTimeFromCustomToNormal("d#m#Y H#i#s", $dateTime4);
     $this->setVars("pureDateTime4", $dateTime4);
     $this->setVars("formattedDateTime4", $dateTime4test);
     $this->view('testDate');
 }
开发者ID:rodph15,项目名称:Odin-Framework,代码行数:52,代码来源:TestDateController.php


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