PHP jdmonthname() returns wrong month name

97 views Asked by At

I am having this problem with jdmonthname() function in php. In my project I have used jdmonthname() in two places. One is working good. But the other one is returning wrong results. I am getting my input from passed into URL(example: http://localhost:8000/doctor_profile/1/2017-03-28).

$schedules['monthName'] = jdmonthname(strtotime($returnCalenderMonth['requestedCalenderMonth']), 1);

where $returnCalenderMonth['requestedCalenderMonth'] has the data '2017-03-28' as string and returns 'January' where it should be March. On input '2017-1-28' it returns 'April' instead of January etc. etc..

I have checked and found that strtotime() function is returning correct value with Unix Timestamp Conversion Tools. I have searched but could not find any reference to this problem. E.g, I am using PHP 5.6, Ubuntu 16.4 x64, Laravel 5.4 for my project.

I will be grateful if somebody can help me. Thanks in advance

0

There are 0 answers