[DUG] Timezones for Bills and things

Ross Levis ross at stationplaylist.com
Thu Nov 24 17:39:25 NZDT 2016


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 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 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20161124/408c6775/attachment-0001.html 


More information about the Delphi mailing list