Author Topic: Change current time  (Read 10072 times)

0 Members and 1 Guest are viewing this topic.

dennisvv

  • Jr. Member
  • **
  • Posts: 1
Change current time
« on: February 20, 2013, 11:11:50 AM »
Hi there,

I'm in the Netherlands, and the chat time is 05:11:06 now, but it should be 12:11:06. How/where can I change this?
Thanks in advance

Dennis

adrianogois3

  • Jr. Member
  • **
  • Posts: 3
Re: Change current time
« Reply #1 on: June 12, 2013, 02:20:50 AM »
I am having the same problem too?????

moralne

  • Jr. Member
  • **
  • Posts: 1
Re: Change current time
« Reply #2 on: July 26, 2013, 11:35:52 AM »
Try this, I don't know if it's correct solution - but for me works perfect!

================================
in:
================================

ww.yourwebsite.com/mibew/libs/chat.php


================================
add similar code in line 100 and 113 of chat.php (can be others one):
================================

date_default_timezone_set('UTC');


================================
it looks like this in my file:
================================


function message_to_html($msg)
{
   global $kind_to_string, $kind_avatar;
   if ($msg['ikind'] == $kind_avatar) return "";
   date_default_timezone_set('Poland');
   $message = "<span>" . date("H:i:s", $msg['created']) . "</span> ";
   $kind = $kind_to_string{$msg['ikind']};
   if ($msg['tname'])
      $message .= "<span class='n$kind'>" . htmlspecialchars($msg['tname']) . "</span>: ";
   $message .= "<span class='m$kind'>" . prepare_html_message($msg['tmessage']) . "</span><br/>";
   return $message;
}

function message_to_text($msg)
{
   global $kind_user, $kind_agent, $kind_info, $kind_avatar;
   if ($msg['ikind'] == $kind_avatar) return "";
   date_default_timezone_set('Poland');
   $message_time = date("H:i:s ", $msg['created']);
   if ($msg['ikind'] == $kind_user || $msg['ikind'] == $kind_agent) {
      if ($msg['tname'])
         return $message_time . $msg['tname'] . ": " . $msg['tmessage'] . "\n";
      else
         return $message_time . $msg['tmessage'] . "\n";
   } else if ($msg['ikind'] == $kind_info) {
      return $message_time . $msg['tmessage'] . "\n";
   } else {
      return $message_time . "[" . $msg['tmessage'] . "]\n";
   }
}


===============================
Hope it works for you too!   ;)
===============================