Results 1 to 3 of 3

Thread: Divergence between date_created in db and in UI

  1. #1
    casimiro is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Default Divergence between date_created in db and in UI

    Dear users,

    I am using soap to create an entry of a custom module. When I create an entry I set, among other things, the field date_entered to some valid datetime. The problem is that the date_entered displayed later is not equal to the value I inserted. But, checking the records on MySQL I can see the value that I inserted.

    I hope I was clear enough. Just in case, here is an example of this problem:
    In the db record, the date_entered is:
    2010-08-11 11:32:00
    But in the GUI:
    08/11/2010 08:32

    PHP Code:
    // Here is the code I call to create the entry
    $data = array(
            
    'name' => $status->name,
            
    'description' => $status->description,
            
    'date_entered' => $status->dateEntered // It's a date('Y-m-d H:i:s',$time)
            
    );
            
    $name_value_list = array();

            foreach(
    $data as $key => $value)
                    
    array_push($name_value_list, array('name' => $key'value' => $value));

            
    $status_id $this->soap->call('set_entry', array(
                    
    'session' => $this->ses,
                    
    'module_name' => 'geral_statuspartner',
                    
    'name_value_list' => $name_value_list)); 
    Thanks,
    Caio.

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

    Default Re: Divergence between date_created in db and in UI

    Dates in Sugar are always stored in UTC, and the UI compensates accordingly based on the time zone of the logged in user.

    If you store your values in UTC as well, it will display correctly in the UI.
    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
    casimiro is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Smile Re: Divergence between date_created in db and in UI

    Thank you very much!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Database time vs Sugar time - date_created
    By Billwobo in forum Help
    Replies: 3
    Last Post: 2008-06-29, 04:24 PM
  2. Order email by most recent Date_Created
    By dsnapp in forum Help
    Replies: 0
    Last Post: 2006-04-03, 03:21 AM

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
  •