Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 10:19 am
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Time zone problem?? - Fixed!
PostPosted: Sat May 05, 2007 12:32 am 
Offline

Joined: Mon May 29, 2006 7:07 pm
Posts: 287
Location: Denver
this is annoying error i get

/var/lib/asterisk/agi-bin/libs_a2billing/Class.A2Billing.php[196]: date(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead.

well i used setup in centos to configure time zone.
When i type date - i get correct time and date. What can cause this??


Last edited by svetur on Sat May 05, 2007 2:30 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat May 05, 2007 7:51 am 
Offline

Joined: Thu Oct 19, 2006 9:56 am
Posts: 300
Location: Athens, Greece
I'm getting this, too. I guess PHP (5.2? ) doesn't like the numeric TZ setting. Anyway, I think that php.ini should be a nice place to explicitly set the date.timezone (or whatever), as the message suggests.


Top
 Profile  
 
 Post subject: Timezone
PostPosted: Sat May 05, 2007 1:53 pm 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
One way to fix this:

In /var/lib/asterisk/agi-bin/libs_a2billing/Class.A2Billing.php

1. Put this near the top:
define('PHP_DEFAULT_TIME_ZONE','America/New_York'); // your php zone

2. Put this as first line in the " write_log " function (approx line 194)
date_default_timezone_set(PHP_DEFAULT_TIME_ZONE);

3. Change this line in the same function from this:
$string_log = "[".date("d/m/Y H:i:s")."]:[CallerID:".$this->CallerID."]:[CN:".$this->cardnumber."]:$output\n";

To something like this:
$string_log = "[".date("r")."]:[CallerID:".$this->CallerID."]:[CN:".$this->cardnumber."]:$output\n";


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 05, 2007 2:23 pm 
Offline

Joined: Mon May 29, 2006 7:07 pm
Posts: 287
Location: Denver
hi, thanks for replies.
I added line

date_default_timezone_set("America/Denver");

to

Class.A2Billing.php
Class.RateEngine.php

and looks like those messages went away. :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 8:56 pm 
Offline

Joined: Fri Apr 28, 2006 5:11 am
Posts: 426
Can we move this stuff to config file??


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 9:11 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I think anyone who runs PHP + SQL for time critical stuff should always set a stable timezone like UTC or GMT to ensure PHP and SQL are guaranteed to be running in the exact same timezone and DST state. A2B looks like it's got preliminary support for translating to the customer's timezone, presumably from a UTC based database. Let's hope this feature materialises soon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group