Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Wrong date Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
francesco
Newbie
Newbie
Avatar

Joined: 06 June 2013
Online Status: Offline
Posts: 14
Posted: 08 June 2013 at 1:38pm | IP Logged Quote francesco

Hi, with afterlogic php version and hmailserver i see that some mail have a wrong date, in particular 1/1/1970 but are order correct. For example: if i receive a mail now, the mail is the last but have 1/1/1970 as date.
What can i do?
Thank you

PS on outlook or other mail client the date is correct... i think is an error in the php code when it convert the date..possible?



Back to Top View francesco's Profile Search for other posts by francesco
 
francesco
Newbie
Newbie
Avatar

Joined: 06 June 2013
Online Status: Offline
Posts: 14
Posted: 08 June 2013 at 5:20pm | IP Logged Quote francesco

I try to check where is the error. I found the function that send 1/1/1970, and is into DateTimeHelper.php:

public static function ParseInternalDateString($sDateTime)
     {

          $oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', $sDateTime, \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
          return $oDateTime ? $oDateTime->getTimestamp() : 0;

     }

But i don't know if the problem is the string that receive or a problem in a function. I see that the correct date appear in this format "May 19, 17:39".

I don't know, i have a lot of issue with this webmail...i hope to help, and that someone help me...
Back to Top View francesco's Profile Search for other posts by francesco
 
francesco
Newbie
Newbie
Avatar

Joined: 06 June 2013
Online Status: Offline
Posts: 14
Posted: 09 June 2013 at 3:04pm | IP Logged Quote francesco

Ok, i fix the bug by myself. The function ParseInternalDateString threw an exception when the date have the number of the day < 10. So I modify the code:


----------------------------------------------------------------------------

public static function ParseInternalDateString($sDateTime)
{
if (strlen(trim($sDateTime)) < 26){
$sDateTime = "0".trim($sDateTime);
}


$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', $sDateTime, \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
          return $oDateTime ? $oDateTime->getTimestamp() : 0;

     }

-------------------------------------------------------------------------------

Bye. (Igor let's call me if you looking for a debugger :-) )
Back to Top View francesco's Profile Search for other posts by francesco
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 10 June 2013 at 12:52am | IP Logged Quote Igor

We have already a few reports on this issue, and though the fix you've made looks correct, there's a simpler way - replace $sDateTime with trim($sDateTime) inside ParseInternalDateString function definition.

Quote:
Bye. (Igor let's call me if you looking for a debugger :-) )


Will definitely keep that in mind!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide