Re: DateTime Component that Supports UTC
- From: "John Herbster" <herb-sci1_AT_sbcglobal.net>
- Date: Thu, 31 Jul 2008 16:53:51 -0500
"Russ Weston" <russ.weston@xxxxxxxxxxx> wrote
Wondering if there is a data-aware DateTime control that reads a database datetime field (stored in UTC format) and displays the value on the screen with respect to the local bias.
Russ,
You can create your own OnGetText handler for the DB field
that has the TDateTime data and add you own local bias correction.
However, I have never found that, by itself, to be useful for historical or future date-times such as are usually stored in a data tables, because the bias values can change over time.
Instead, I prefer to record GMT (a.k.a. UT1 or UT2, but not UTC) *and*, in another field, the local time offset for the point where the date-time applied or applies. Then in the display you can change how your OnGetText event handler controls the correction for bias, using both field, if required.
Regards, JohnH
PS: Microsoft misuses the term "UTC". UT1, UT2, and GMT days have 24 hours, with each hour having 60 minutes, and each minute having 60 seconds, with the seconds synchronized to the rotation of the earth by stretching or compressing their length. UTC time is based on constant length seconds with an occasional 59 or 61 second minute used to synchronize UTC with the rotation of the earth. .
- Follow-Ups:
- Re: DateTime Component that Supports UTC
- From: Russ Weston
- Re: DateTime Component that Supports UTC
- Prev by Date: Re: desktop app talk with service app
- Next by Date: Re: Looking for PDF to JPG/PNG converter
- Previous by thread: Re: desktop app talk with service app
- Next by thread: Re: DateTime Component that Supports UTC
- Index(es):
Relevant Pages
|