下面是jdate库jdate
我的format.php文件
<?php
/**
*Format Class
*/
class Format{
public function formatDate($date){
return date('F j, Y, g:i a', strtotime($date));
}
public function textShorten($text, $limit = 400){
$text = $text. "";
$text = substr($text, 0, $limit);
$text = substr($text, 0, strrpos($text, ' '));
$text = $text. "";
return $text;
}
}
?>
和我的邮寄日期代码
<h6><?php echo $fm->formatDate($result['date']); ?>, by<a href="#"><?php echo $result['author']; ?></a></h6>
我如何使用jdate而不是公历时间。
发布于 2018-08-18 22:16:41
您应该包含jdf.php文件,然后使用jdate而不是date
<?php
/**
*Format Class
*/
include_once('jdf.php');
class Format{
public function formatDate($date){
return jdate('F j, Y, g:i a', strtotime($date));
}
public function textShorten($text, $limit = 400){
$text = $text. "";
$text = substr($text, 0, $limit);
$text = substr($text, 0, strrpos($text, ' '));
$text = $text. "";
return $text;
}
}
?>
有关更多信息和帮助,请参阅this link
https://stackoverflow.com/questions/51909436
复制相似问题