Newbie questions about Pliant

Newbie questions about Pliant

Time and Date

Change time and date
Message posted by maybe Rogerio Justino on 2001/09/10 06:41:19
How can I change the Pliant time (GMT), to my local time ?
Message posted by maybe Hubert Tonneau on 2001/09/10 09:24:21
You can't.
At the moment, it you want to use local time within Pliant, you have to set
operating system time to be local time, then specify that you lieve in
Greenwich so that no extra delta is applied at operating system level.

The system (should also be GMT) time <-> local time conversion seams to be
part of glibc under Linux, and I don't know how it works under Win32.

If I coult ask the operating system about the delta between system and local
time, I could (quite) reliably provide local time.
Anyway, there would still be several problems with local time: in stupid
countries (such as France) applying daylight saving, the conversion is
ambiguous because the delta is changing twice a year.

What I plan to do for Pliant (also I have not done it yet because I'm a
bit lazy), is enable you to record the delta in Pliant configuration file,
then add a 'local' option to the Date and DateTime <-> Str conversion so
that delta is applyed.
There would also be a 'gmt' option that force to ignore the delta,
and a global setting in the Pliant configuration file that specifies if the
default is 'local' or 'gmt'

Any comment from Patrice ?


Message posted by maybe Patrice Ossona de Mendez on 2001/09/11 16:45:50
UTC to local time conversion is not really easy and the converse is not always possible. Sources for local time data may be found at Sources for Time Zone and Daylight Saving Time Data site. The code and data may be downloaded using wget or ftp (see the site). The problem is you have to keep all the informations and strategy of different countries.

If a translation would be made in Pliant system, an automatic converter should translate the standard data files to database records for further uses.

A minor problem is to find the ISO code of the timezone under different OS, but this should not be a huge problem.

Note: Windows seems to be quite buggy when handling UTC-local time conversions...