mercredi 21 février 2018

Carbon PHP Library issue

Hello I have problem with PHP Library called Carbon. It sometimes returning yesterdays date. I am using Arch Linux.

Here is my time settings:

$ timedatectl                                                                       
                      Local time: Wed 2018-02-21 17:28:24 +08
                  Universal time: Wed 2018-02-21 09:28:24 UTC
                        RTC time: Wed 2018-02-21 09:28:24
                       Time zone: Asia/Manila (+08, +0800)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

I compare my date with the date on this site. I confirm that I have the right and exact time.

The problem is when I try to use Carbon library, on my php code, it sometimes returning yesterdays date. I am experiencing this right now and last week.

dd(Carbon::now('Asia/Manila'));

Output:

Carbon @1519134564 {#793 ▼
  date: 2018-02-20 21:49:24.720553 Asia/Manila (+08:00)
}

Even with no specified timezone

dd(Carbon::now());

I am using Laravel Framework by the way.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire