mardi 6 février 2018

Carbon::now returns wrong month

I'm trying to make cron job for my system. The project is configured for time zone that differs from mine I tried

$timezone = date_default_timezone_get();
$current = Carbon::now(new \DateTimeZone($timezone));

It returns 2018-01-05 06:36:15 which had a wrong month I tried $current_m = date('y-m-d h:m'); which returned

18-02-06 06:02

which had right date but wrong time what should I do? I need to be using carbon $ I'm using laravel 5.4



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire