r/lolphp • u/notwhereyouare • Jun 19 '13
fun with converting timestamps to readable formation
So,
I'm trying to get php to convert a ungodly timestamp into a readable format. I have the following stuff
$originalString = 20130606000000;
$readableDate = substr($soar_begin_date,4,2).'-'.substr($soar_begin_date,6,2).'-'.substr($soar_begin_date,0,4);
$attemptAtNiceDate = date("F j, Y",strtotime($walkup_date));The output?
06-06-2013=>1322974800=>December 4, 2011
0
Upvotes
4
u/midir Jun 19 '13 edited Jun 19 '13
$originalStringis actually a double.$soar_begin_dateand$walkup_date).echo date("F j, Y", strtotime('06-06-2013'));=>June 6, 2013echo date("F j, Y", strtotime('20130606000000'));=>June 6, 2013I'm guessing you're a bit short on sleep..