FoxSecrets
Active member
I am trying to show date 1 year from now and save it in unix timestamp, but no success.
The form below shows me "Jul 28, 2024", but when I pickup any date it shows in different format e.g. 2024-07-28.
How to show and pickup on the same format?
And during the saving process, it shows "now plus 20 hours", non sense.
How to correctly save it in unix timestamp format?
The form below shows me "Jul 28, 2024", but when I pickup any date it shows in different format e.g. 2024-07-28.
How to show and pickup on the same format?
Code:
<xf:dateinput name="expiration" id="expiration" value="{{ date($xf.time + 31536000) }}" required="true" />
And during the saving process, it shows "now plus 20 hours", non sense.
How to correctly save it in unix timestamp format?
Code:
$input = $this->filter([
'expiration' => 'uint',
]);
$input['expiration'] = strtotime($input['expiration']);
Last edited: