[DUG] Timezones for Bills and things
Jolyon Direnko-Smith
jsmith at deltics.co.nz
Fri Nov 25 10:43:30 NZDT 2016
It varies according to the _file_system_, not the edition/version of
Windows:
For NTFS volumes, file timestamps are stored in UTC
For FAT volumes (incl. FAT32, extFAT etc) file timestamps are stored in
local time.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx
But all of this is about file time stamp storage and has nothing to do with
how date times should be stored in a database (other than the fact that the
NTFS file system stores date/times in UTC and converts them to local time
for display, which in general terms is the advisable way to go about
things).
On 25 November 2016 at 09:59, Rohit Gupta <rohit at cfl.co.nz> wrote:
> Thanks Ross,
>
> however I would dispute that windows stores file timestamps in utc.
> Because twice a year there is mayhem as only some files change their
> timestamp by an hour. And these files are different on different
> workstations.
>
> Maybe it's true for the server version of windows.
>
> Rohit
>
>
> On 24/11/2016 17:39, Ross Levis wrote:
>
> I suggest store in UTC, like Windows does for file timestamps, and use
> Windows functions like GetTimeZoneInformation and
> SystemTimeToTzSpecificLocalTime to convert to locale time for
> display/printing purposes. A timezone database shouldn’t be required.
>
>
>
> *From:* delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces@
> listserver.123.net.nz <delphi-bounces at listserver.123.net.nz>] *On Behalf
> Of *Stefan Mueller
> *Sent:* Thursday, 24 November 2016 5:21 p.m.
> *To:* 'NZ Borland Developers Group - Delphi List'
> *Subject:* Re: [DUG] Timezones for Bills and things
>
>
>
> https://github.com/pavkam/tzdb has such a timezone database (2014 data).
> Using that library makes it easy to convert between timezones.
>
> I think http://www.iana.org/time-zones hosts the latest up to date time
> zone data that this tzdb database is based on in case you want to update it
> to the latest 2016 data.
>
>
>
> Or you could rewrite your application to use Oracle Database … they do
> have a timestamp datatype for your table columns so when you
> select/insert/update a table all you need to do is to set the correct
> locale and the database will do the conversion for you.
>
> https://docs.oracle.com/database/121/NLSPG/ch4datetime.htm#NLSPG263
>
>
>
> Kind regards,
>
> *Stefan Müller*,
> R&D Manager
>
> *ORCL* *Toolbox Ltd.*
> Auckland, New Zealand
>
>
> P Please consider the environment before printing this email
>
> This message is intended for the adresse named above and may contain
> privileged or confidential information.
> If you are not the intended recipient of this message you must not use,
> copy, distribute or disclose it to anyone.
>
>
>
> *From:* delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces@
> listserver.123.net.nz <delphi-bounces at listserver.123.net.nz>] *On Behalf
> Of *Rohit Gupta
> *Sent:* Thursday, 24 November 2016 4:19 p.m.
> *To:* NZ Borland Developers Group - Delphi List
> *Subject:* [DUG] Timezones for Bills and things
>
>
>
> We finally have to deal with time zones. We use the server date-time
> everywhere, rather than relying on workstation date-times. This is not an
> interactive forum type application where the flow of data is merged from
> various timezones. It is a business management system with appointments
> and bills etc. The timestamps of these records have to remain as created.
> But they can not come from the workstation clock.
>
> Going forward, a database server could be servicing workstations in
> different time zones.
>
> I am considering
>
> 1. Set the server time as UTC
> 2. Keep a table for time zone versus branch (how do I keep this upto
> date at daylight saving boundaries)
> 3. Use the utc + timezone difference to stamp each bill or appointment
> made for each branch.
>
> How is everyone else handling it ?
>
> Regards
>
> Rohit
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
>
>
> --
>
> Regards
>
> *Rohit Gupta*
> B.E. Elec., M.E., Mem IEEE, Mem IET
> Technical Director
> Computer Fanatics Ltd
>
> *Tel *4892280
> *Fax *4892290
> *Web *www.cfl.co.nz
> ------------------------------
> This email and any attachments contain information, which is confidential
> and may be subject to legal privilege and copyright. If you are not the
> intended recipient, you must not use, distribute or copy this email or
> attachments. If you have received this in error, please notify us
> immediately by return email and then delete this email and any attachments.
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20161125/bc3c9a6c/attachment-0001.html
More information about the Delphi
mailing list