<?php $d = date_parse_from_format("Y-m-d H:i:s", "2017-02-22 16:24:12"); $ds = sprintf("/base/%d/%02d/%d", $d['year'], $d['month'], $d['day']); echo $ds; ?>
<?php $dateString = '2017-02-22 16:24:12'; $base = "/monitor/"; $path = "$base".date('Y/m/d/',strtotime("$dateString")); echo $path; ?>
1 Comment
Anonymous