Tim Mckay Posted June 17, 2019 Share Posted June 17, 2019 Howdy everyone, I am very new to uniGUI, and am absolutely loving it. I am converting a 200,000 lines IntraWeb app to uniGUI. Because our users are international, we are storing all dates in our SQL database in UTC. My question is theoretical and practical: 1) What I have tried which mostly works... I have a TClientDataSet and have added all the Fields. For each of the TDateTimeFields, I have implemented OnGetText and OnSetText events which works very nicely on the TUniDBGrid. The OnGetText takes the database UTC Datestamp, converts to TTimezone.Local based on short date format. My OnSetText takes the user input from Local and converts to UTC and saves to the dataset. What I have found so far is that the TUniDBDateTimePicker control looks at the database values and for some reason the OnGetText/OnSetText event handlers of the TDateTimeFields don't fire... so my users would see UTC and edit UTC which would be totally confusing. I suppose in theory I could take their inputs and handle the OnChange/OnChangeValue events of the TUniDBDateTimePicker, but that doesn't solve the issue of the control showing UTC values from the database and not Local timezone. One option I had considered was to create a sub-class of just using the TUniDateTimePicker (not the DB one), and implement my own handling of the Load/Save events with the appropriate conversions. 2) What general advice would you advise in regards to making it possible to edit dates & times in local timezone and store in UTC. Maybe I'm just going at this the wrong way, and if there are better ways of showing and editing in Local time/date but save to UTC, I would love to know. Many thanks in advance! Tim Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 17, 2019 Share Posted June 17, 2019 Hello, Can you please specify which edition and build of UniGUI are you using?! Quote Link to comment Share on other sites More sharing options...
Tim Mckay Posted June 17, 2019 Author Share Posted June 17, 2019 Wow, Thanks for the super quick reply. This is only with the Free/trial edition at this time. v 1.90.0 build 1500 is what it says on the startup page. (Using RAD Studio XE7 with C++ and Delphi personalities, if that makes a difference). Also have SDAC, EntityDAC, Castalia, IntraWeb, CodeSite and JEDI installed. Thanks, Tim Quote Link to comment Share on other sites More sharing options...
Tim Mckay Posted July 7, 2019 Author Share Posted July 7, 2019 Howdy; I've gone a head and purchased a Pro-complete license, and am running on the registered v 1.9.0.1504 now. Any thoughts on how I can address the editing of Local vs storage of GMT/UTC time? Thanks in advance, Tim Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 8, 2019 Share Posted July 8, 2019 22 minutes ago, Tim Mckay said: I've gone a head and purchased a Pro-complete license, and am running on the registered v 1.9.0.1504 now. Hello, Please adjust your forum email address: http://forums.unigui.com/index.php?/topic/6291-new-users-please-adjust-your-forum-email-address/ Quote Link to comment Share on other sites More sharing options...
Tim Mckay Posted July 8, 2019 Author Share Posted July 8, 2019 "K'pla" - some random Klingon, Star Trek. Quote Link to comment Share on other sites More sharing options...
Tim Mckay Posted July 8, 2019 Author Share Posted July 8, 2019 (I changed it on the forums side, because I registered my license with my work email, and so I updated the forum here to be my work email address.). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.