If the the date is in a string format like "20142311.235504" then this can easily be convert to a proper php date object with one line code.
How to split a date string into a date object in php
If the string is a date, you can do this :
$num = "20142311.235504";
// You create a date with your string according to your current format
$date = date_create_from_format("Ydm.His", $num);
// Now you can play with it
$formattedDate = $date->format("Y/d/m H:i:s"); // `string(19) "2014/23/11 23:55:04"`
$dateTest['year'] = $date->format("Y"); // 2014
$dateTest['Month'] = $date->format("m"); // 11
$dateTest['day'] = $date->format("d"); // 23
$dateTest['hour'] = $date->format("H"); // 23
$dateTest['min'] = $date->format("i"); // 55
$dateTest['sec'] = $date->format("s"); // 04
Oyelyrics Admin
March 03, 2022 at 04:04 pmwow. thanks a lot for this. exactly what i looked for.