$this->created_at为时间戳值,转换日期如下

date('m.d',$this->created_at) :  y 代表年的后两位如 17 ,Y 代表 2017  , m 代表数字月,M 代表英文月 ,d代表日,D代表星期 (英文的)

 

想要显示中文星期,则要:

 $weeks =['周一','周二','周三','周四','周五','周六','周日'];

$weeks[date('w',$this->created_at)];

就会显示周几。

相关文章:

  • 2021-09-11
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案