Webklex / laravel-imap

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
https://www.php-imap.com
MIT License
637 stars 182 forks source link

How do I get the same date and time that appears in the mailbox? #464

Open albertopinilla opened 1 year ago

albertopinilla commented 1 year ago

How do I get the same date and time that appears in the mailbox? The date returned by getDate() is not the correct one, I am getting it with the attribute 'x_ms_exchange_crosstenant_originalarrivaltime' but it is not the correct one either, it has an offset with respect to Received. Obviously I know that the date is in UTC, but it doesn't return the same as the one shown in the mailbox.

Screenshot 2023-02-28 215128

Screenshot 2023-02-28 215336

image

Webklex commented 1 year ago

Hi @albertopinilla , you might have to experiment with setting the timezone afterwards:

Take a look at the official carbon documentation: https://carbon.nesbot.com/docs/

You can also try to set your laravel timezone and see if this helps to move the time into the right direction: https://laravel.com/docs/10.x/configuration#introduction

Best regards & happy coding,