Home > Q&A > body text
Can anyone help me to see how to convert the time format 20182800255 into 2018-02-08 00:02:55?
If the month, day and hour are 1 digit
董先生2018-02-11 13:31:15
First take out the time and then process it, example:
<?php
Do not need if if IF will directly remove the monthly format by 10,
Then, take out a specific position to judge the value, and output it after processing.
<?php //Please enter your php code $y=date("Y"); $m=date("m")/10*10; $d=date("d"); $t=date("H:i:s"); echo $y."-".$m."-".$d." ".$t."<br>"; ?>