Reputation: 27
i have this french date format :
(Samedi, Aout 31, 2013)
and i want to get only the (M) of the date, for example for August i only want the (Aug)
PS : August in english = Aout in french
Upvotes: 0
Views: 327
Reputation: 6269
$stamp = strtotime("Samedi, Aout 31, 2013");
$month = strftime("%b", $stamp);
...or more concisely:
echo strftime("%b", strtotime("Samedi, Aout 31, 2013"));
Upvotes: 0
Reputation: 3665
<?php
$date = 'Samedi, Aout 31, 2013';
$time = strtotime($date);
$month_only = date('M', $time);
echo $month_only;
Upvotes: 1