Results 1 to 4 of 4

Thread: Sugar Dates in DB off GMT by 35 minutes

  1. #1
    Join Date
    Jan 2011
    Location
    Austin, TX
    Posts
    8

    Exclamation Sugar Dates in DB off GMT by 35 minutes

    Hello and thanks for any insight into this!

    I am working on an installation of Sugar and have uncovered a very bizarre issue. Datetimes are being stored in the MySQL database 35 minutes after GMT.

    The server is set to UTC and synced with NTP.

    All three of these output the correct UTC time, but when I edit a record and then check the date_modified moments later (via the api) it is off by exactly 35 minutes.

    1. $ date -u

    2. mysql> select UTC_TIMESTAMP();

    3. make a file named time.php, put this code into it and then execute it: $ php time.php
    PHP Code:
    <?php
         date_default_timezone_set
    ('UTC');
         echo 
    date('G:i:s');
    ?>

    It seems that API retrieves the exact date in the database without doing any timezone transformations. Is that true?

    The weirdest part is that the result is off by 35 minutes. If it was a factor of an hour, or even 15 minute interval I could assume it was a timezone issue, but this seems like Sugar is adding 35 minutes to GMT.

    What method does Sugar use to get the GMT time? Does it use a php method? Any ideas where to look next for tracking this down?

    Thank you so much for any help with this.
    Last edited by danny_mulvihill; 2011-02-28 at 07:13 PM.

  2. #2
    Join Date
    Jan 2011
    Location
    Austin, TX
    Posts
    8

    Default Re: Sugar Dates in DB off GMT by 35 minutes

    I just came across the get_server_info() method available in the API and am getting the same results:

    Code:
    Array
    (
        [flavor] => PRO
        [version] => 6.1.0
        [gmt_time] => 2011-02-28 18:33:43
    )
    But GMT is 17:58:43.

    Any ideas out there?

  3. #3
    Joe9898 is offline Junior Member
    Join Date
    Mar 2011
    Posts
    2

    Default Re: Sugar Dates in DB off GMT by 35 minutes

    hey guys!
    where can I find the implementation of get_server_info() method available in the API that returns server information such as version, flavor, and gmt_time.

    thanks

  4. #4
    Join Date
    Jan 2011
    Location
    Austin, TX
    Posts
    8

    Default Re: Sugar Dates in DB off GMT by 35 minutes

    The first place you can get some info is by going here in a browser:
    http://localhost/service/v3_1/rest.php
    (Assuming you're working locally.)

    The actual files are here:
    <sugar root>/service/core/REST/*

    There is some more info about it here: (the link is anchored to the right spot btw :-)
    Developer's Guide
    If that link doesn't work, just click it again. It should since you already have a session with Sugar though)

    If you need some help getting started with the API check this out:
    Being RESTful with SugarCRM

    I hope this helps you out.

    Now does anyone have some advice on my 35 minutes off issue? :-)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to set up due dates based on business dates
    By sugar7478 in forum Developer Help
    Replies: 0
    Last Post: 2009-02-27, 02:27 PM
  2. Replies: 2
    Last Post: 2009-02-16, 06:32 AM
  3. Replies: 0
    Last Post: 2009-01-22, 05:58 PM
  4. Search between dates in Sugar 5.x
    By alesandro in forum Developer Help
    Replies: 1
    Last Post: 2008-03-28, 12:21 AM

Tags for this Thread

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
  •