Convert MMDDYYYY to date for PHP

前端 未结 6 623
你的背包
你的背包 2021-01-14 10:46

I have a string with a date which is in this format MMDDYYYY (ie. 01132012, 01142012 etc.)

I need to do something on a page, if that string is 14 days or less from t

6条回答
  •  离开以前
    2021-01-14 11:16

    try date('m-d-y', strtotime('01142012'));
    

    could also try something like;

    $var = strtotime('01142012');
    $var2 = date ('F j, Y', $var);
    

提交回复
热议问题