I have javascript that turns dates in my view to a time string using getTime(). That then is stored as a value for an option in my select form. Once it is passed to php, how do I turn that into a php date?
I have done:
echo date("m/d/Y", '1345618799000');
1345618799000 = Tue Aug 21 2012
You use PHP's date() function:
date("Format here (see documentation)", round($_POST["time_field"]/1000));
Updated, thanks Yoshi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With