views:

177

answers:

2

Hello,

Im using Mantis bug tracker v1.1.8, and the Horde Webmail System for my company emails. When emails sent by Mantis arrive in my company inbox, i get Unknown Date in the Date field of the inbox view. When i open the message, i see the Date like Thu, 31 Dec 2009 14:32:15 +0580. The other mails, whose date i can see in the Inbox view have date in a format like Mon, 21 Dec 2009 06:56:18 +0100 [12/21/2009 11:26:18 AM IST] . For your reference i have pasted below the contents of my config_inc.php

<?php
    $g_hostname = 'localhost';
    $g_db_type = 'mysql';
    $g_database_name = 'bugtracker_mantis';
    $g_db_username = 'root';
    $g_db_password = '';

    # select the method to mail by:
    # 0 - mail()
    # 1 - sendmail
    # 2 - SMTP
    $g_phpMailer_method = 2;

    # This option allows you to use a remote SMTP host. Must use the phpMailer script
    # Name of smtp host, needed for phpMailer, taken from php.ini
    $g_smtp_host = <my_smtp_host>;
    $g_administrator_email = <my_administrator_email>;
    $g_webmaster_email = <my_webmaster_email>;
    $g_from_email = <my_from_email>;


   putenv("TZ=Asia/Calcutta");

   #Date Settings
   $g_default_language = 'english'; 
   $g_short_date_format = 'dm-Y'; 
   $g_normal_date_format = 'dmY H: i'; 
   $g_complete_date_format = 'm-d-y H:i T'; 

?>

Any way to fix this problem ? Thank You

A: 

You should also use below function to set your default time zone:

putenv("TZ=Asia/Calcutta");
date_default_timezone_set("TZ=Asia/Calcutta");

I hope that works for you :)

Sarfraz
Thanks for the reply Sarfraz. I added date_default_timezone_set("TZ=Asia/Calcutta"); , but i still get Unknown Date. Is there some other way to fix this ?
Timw
Could this be a problem with Horde Webmail and not Mantis ? .
Timw
it could possibly be problem with Horde Webmail
Sarfraz
A: 

You could compare the (header) source text of a mantis email and a "working" email.

This should give you insight if it really is a mantis related problem.

Edit:

Thu, 31 Dec 2009 14:32:15 +0580

Is +0580 a valid timezone?

Edit2:

instead of

date_default_timezone_set("TZ=Asia/Calcutta");

try this:

date_default_timezone_set("Asia/Calcutta");

Also try to verify that the timezone is correctly set in mantis - you could also enforce it in your php.ini.

Karsten
Thanks for the reply Karsten. The Date and Received fields in the header of mantis and other mails are http://pastie.org/762374 . Do you think there is some problem here ?
Timw
I think +0580 could be a problem, and it should be +0530 instead, which is the case for other emails. Any way i can make this change for Mantis emails ?
Timw
see my edit2, maybe it helps :)
Karsten
Thanks for the reply Kirsten. Its fixed now ! :). The problem was actually being caused by a bug in class.phpmailer.php, which returns an incorrect timezone code of 0580 instead of 0530 for IST. I saw the bug report at http://old.nabble.com/small-bug-in-timezone-code-td13320733.html . I made that change in my Mantis installation, and now everything works as it should ! :)
Timw