Index: /branches/2.2/mobile/inc/class.mobiletemplate.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 3484)
+++ /branches/2.2/mobile/inc/class.mobiletemplate.inc.php	(revision 3499)
@@ -54,5 +54,10 @@
 			$this-> template->set_var('lang_email', lang('E-mail'));
 
-			$save_in_folder = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] : "-1";
+                        $obj = createobject("expressoMail1_2.functions");
+                        // setting timezone preference
+                        $zones = $obj->getTimezones();
+                        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));
+
+                        $save_in_folder = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] : "-1";
 			$save_in_folder = @eregi_replace("INBOX/", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
 			$save_in_folder = @eregi_replace("INBOX.", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
Index: /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php
===================================================================
--- /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 3466)
+++ /branches/2.2/mobile/inc/class.ui_mobilemail.inc.php	(revision 3499)
@@ -496,5 +496,5 @@
 						$p->set_var('subject', $subject);
 						$p->set_var('msg_number', $msg['msg_number']);
-						$p->set_var('date', $msg['udate']);
+						$p->set_var('date', $msg['smalldate']);
 						$p->set_var('msg_folder', $this->folders[$this->current_folder]['folder_id']);
 						$p->set_var('from_label', lang('From'));
Index: /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3493)
+++ /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3499)
@@ -210,4 +210,20 @@
 		$head_array['msg_number'] = $msg_number;
 		$head_array['udate'] = $header->udate;
+                $head_array['offsetToGMT'] = $this->functions->CalculateDateOffset();
+
+                $msgTimestamp = $header->udate + $head_array['offsetToGMT'];
+		$date_msg = gmdate("d/m/Y",$msgTimestamp);
+//		if (date("d/m/Y") == $date_msg)
+//			$return['udate'] = $header->udate;
+//		else
+
+		if (date("d/m/Y") == $date_msg) //no dia
+		{
+			$head_array['smalldate'] = gmdate("H:i",$msgTimestamp);
+                }
+                else
+                {
+			$head_array['smalldate'] = gmdate("d/m/Y",$msgTimestamp);
+                }
 
 		$from = $header->from;
@@ -568,8 +584,8 @@
 
 		$date_msg = gmdate("d/m/Y",$msgTimestamp);
-		if (date("d/m/Y") == $date_msg)
-			$return['udate'] = gmdate("H:i",$msgTimestamp);
-		else
-			$return['udate'] = $date_msg;
+//		if (date("d/m/Y") == $date_msg)
+//			$return['udate'] = $header->udate;
+//		else
+		$return['udate'] = $header->udate;
 
 		$return['msg_day'] = $date_msg;
@@ -771,5 +787,5 @@
 		//All this is to help in local messages
 		//$return['timestamp'] = $header->udate;
-                $return['timestamp'] = $header->udate_original;
+                $return['timestamp'] = $header->udate;
 		$return['login'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id'];//$GLOBALS['phpgw_info']['user']['account_id'];
 		$return['reply_toaddress'] = $header->reply_toaddress;
Index: /branches/2.2/expressoMail1_2/js/draw_api.js
===================================================================
--- /branches/2.2/expressoMail1_2/js/draw_api.js	(revision 3493)
+++ /branches/2.2/expressoMail1_2/js/draw_api.js	(revision 3499)
@@ -840,5 +840,5 @@
                 if (typeof offsetToGMT == 'undefined')
                 {
-                    offsetToGMT = 0;
+                    offsetToGMT = headers_msgs.offsetToGMT;
                 }
 		var tr_element = document.createElement('tr');
