Reputation: 15
I have a date like this:
11 Jun 2017
I want to format it like
11.06.2017
I try strtotime
but turn 1970
$arrival = date("d.m.Y", strtotime($_POST['arrival']));
$departure = date("d.m.Y", strtotime($_POST['departure']));
I am try php 5 and 7 versions. And date is dynamic language
if page english Jun if page turkish Haz like this
Upvotes: 1
Views: 97
Reputation: 33813
strtotime
in conjunction with date
seems to work OK for the given string
$str='11 Jun 2017';
echo date('d.m.Y',strtotime( $str ) );
outputs
11.06.2017
Upvotes: 1