jjzjj

DateInterval

全部标签

php - 'P' 在 DateInterval 格式中代表什么?

考虑以下引用自phpmanualforDateTime的示例sub(newDateInterval('P10D'));echo$date->format('Y-m-d')."\n";?>“D”代表天数,“P”在该格式中代表什么? 最佳答案 来自themanualIntervalspecification.TheformatstartswiththeletterP,for"period."Eachdurationperiodisrepresentedbyanintegervaluefollowedbyaperioddesignator