Converting date From one format to another

前端 未结 4 1465
暗喜
暗喜 2021-01-15 05:21

iam having the date format stored in database as \"20100723\"(YYYYMMDD) and how do i convert it into \"23-JUL-2010\"

4条回答
  •  执笔经年
    2021-01-15 05:32

    $original = "20100723";
    $converted = date("d-M-Y", strtotime($original));
    

    See manual: date(), strtotime()

提交回复
热议问题