Results 1 to 5 of 5

Thread: Database time differs from sugar interface!

  1. #1
    Tavares is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    120

    Default Database time differs from sugar interface!

    Hi!
    I have what it seems to be a problem...i'm pushing some data from Sugar Database, and when i display this data in sugar it comes with a hour less that sugar displays in the DetailView of Case,notes....
    I'm in portugal, i have configured all my timezone do Europe/Lisbon (GMT+0) (+DST) my database collation is utf8-general-ci-collation.

    Am i missing something here?


    Thanks

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Database time differs from sugar interface!

    Don't you have to use GMT+1 instead to account for Daylight Savings Time (DST) ?
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    JeanetteRoss is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    61

    Cool Re: Database time differs from sugar interface!

    I have the same issue in the UK - I have my time set for London.....With DST+0. Put in 3 and it goes in as 2.

    I have had to alter all the reports.

  4. #4
    broon is offline Junior Member
    Join Date
    Nov 2006
    Posts
    4

    Default Re: Database time differs from sugar interface!

    Same issue here.. I'm in the Eastern (EDT / new_york) US time zone and my time is off by 4 hours... Looks like it is set to GMT somewhere...
    Last edited by broon; 2007-08-02 at 03:32 PM.

  5. #5
    broon is offline Junior Member
    Join Date
    Nov 2006
    Posts
    4

    Talking Re: Database time differs from sugar interface!

    OK... Pretty sure that THIS IS NOT A GOOD IDEA, however, you can modify SugarBean.php and fix this problem. This solution seems to work but is untested beyond creation of an Opportunity.


    Old Code:

    if(empty($this->date_modified) || $this->update_date_modified){
    $this->date_modified = gmdate("Y-m-d H:i:s");
    Modified to:

    if(empty($this->date_modified) || $this->update_date_modified){
    $gmt_offset = time()-14400;
    $this->date_modified = gmdate("Y-m-d H:i:s",$gmt_offset);

    where 14400 is -5 (US eastern time offset) * 60 * 60. This should be modified to your time zone.

    I got this idea from http://us2.php.net/gmdate which might help.

    Also note that this was done on 4.2.1a which is pretty old. It did however look the same in 4.5 but I did not test it...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Big Security worries with Sugar!
    By mycrmspacegunnar in forum General Discussion
    Replies: 28
    Last Post: 2007-07-29, 05:27 AM
  2. step 3 installation problem
    By voitek in forum Installation and Upgrade Help
    Replies: 10
    Last Post: 2007-02-14, 04:35 PM
  3. Replies: 1
    Last Post: 2006-07-02, 02:53 PM
  4. Replies: 2
    Last Post: 2006-03-12, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •