Hello guys, I'm trying to convert some timestamps into readable dates using the my_date function.
When I run the function without custom time format it works well.
When I use the custom format I wish, it returns me a warning concerning the Year piece (I assume the problem comes with Year due to function outputs, pasted at the end of this post).
Custom format I'm trying to use:
Function setup I'm using:
Warning I'm being returned when the custom format is added into the function:
Here are the outputs I get:
Without custom format
With custom format:
Original timestamp:
Do you have any clue about what's wrong with my setup?
When I run the function without custom time format it works well.
When I use the custom format I wish, it returns me a warning concerning the Year piece (I assume the problem comes with Year due to function outputs, pasted at the end of this post).
Custom format I'm trying to use:
F j Y - H:i
Function setup I'm using:
my_date("F j Y - H:i", $mybb->settings['dateformat'], $serial['date'])
Warning I'm being returned when the custom format is added into the function:
<error>
<dateline>1607729566</dateline>
<script>inc/functions.php</script>
<line>539</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>A non-numeric value encountered</message>
<back_trace>#0 errorHandler->error() called at [/inc/functions.php:539]
#1 my_date() called at [/custom.php:112]
</back_trace>
</error>
Here are the outputs I get:
Without custom format
12-01-2020
With custom format:
December 1 185274 - 11:00
Original timestamp:
1606817915
Do you have any clue about what's wrong with my setup?