Date / Time not parsing correctly
-
Using Advanced Customs Fields with the Date and Time add on will trip up Admin Columns when using the Date/Time field.
Dates before / around September 8th, 2001 are saved as 9 numbers * 1000 resulting in 12 numbers to store the time. Dates after September 8th are saved as 10 numbers * 1000, resulting in 13 numbers.
In version 2.3.5 of Admin Columns:
Lines 898 – 901 in column.phpif ( is_numeric( $date ) && 13 === strlen( trim( $date ) ) ) {
$date = substr( $date, 0, -3 );
}These lines fail to take in to account dates before September 8th 2001 as they are only 12 characters long but still saved as milliseconds (* 1000). This results in Admin Columns not being able to parse the unix time as it will try to parse the 12 character string and not remove the milliseconds.
The topic ‘Date / Time not parsing correctly’ is closed to new replies.