I am using laravel imap extension https://www.php-imap.com/api/message And I can get date of message like this
$message->getDate()->toDate();
or
$message->date->toArray()[0]->toArray()['formatted'];
The problem is that date differs in mailbox and the one I get via imap. For example in mailbox date of message is 2022-09-12 11:45 but I get
["date"]=> string(26) "2022-09-12 15:45:34.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Is there any way to get real date that in mailbox?
I've also tries to use pure php imap but I get the same result.
I get mails from different mailboxes so timezones in there can differ, I do not know in advance to which timezone I should switch from UTC