Difference between revisions of "PascalTZ"

From Lazarus wiki
Jump to navigationJump to search
(Initial edit)
 
Line 2: Line 2:
 
PascalTZ stands for "Pascal Time Zone". It allows you to convert local times to GMT/UTC/Zulu and across time zones taking in account the different rules for this change on every time zone. PascalTZ uses the public database available at http://www.twinsun.com/tz/tz-link.htm to know how to change time for any past time (rules changed over the years) and it is almost 100% reliable for times in 20th and 21th century, and quite precise for prior times as some rules in 19th century and before were never properly documented. Time zone changes for the future times are not reliable as the rules can change sometimes suddenly like Venezuela 2007 change proposed a bunch of days before the change, or the 2009 Argentina ones.
 
PascalTZ stands for "Pascal Time Zone". It allows you to convert local times to GMT/UTC/Zulu and across time zones taking in account the different rules for this change on every time zone. PascalTZ uses the public database available at http://www.twinsun.com/tz/tz-link.htm to know how to change time for any past time (rules changed over the years) and it is almost 100% reliable for times in 20th and 21th century, and quite precise for prior times as some rules in 19th century and before were never properly documented. Time zone changes for the future times are not reliable as the rules can change sometimes suddenly like Venezuela 2007 change proposed a bunch of days before the change, or the 2009 Argentina ones.
  
(Next contents to be extended soon)
+
The unit can:
  
Its main caracteristics are :
+
* Convert a given time/date in local time to/from GMT time.
 +
* Convert a given time/date across two zone times.
 +
* In the conversion process detect invalid times.
 +
* Be updateable simply upgrading the [http://www.twinsun.com/tz/tz-link.htm TZ Database]
  
* ...
+
The download contains the component, an installation package and a demo application, that illustrates the features of the component along with some instrumentation for evaluating the component on a given system. The unit can also used in non Lazarus projects (plain fpc applications) as the unit does not require any user graphic interface but is included as a package for easy integration in applications.
* ...
 
* etc
 
 
 
The download contains the component, an installation package and a demo application, that illustrates the features of the component along with some instrumentation for evaluating the chart on a given system.
 
 
 
 
 
=== Screenshot ===
 
 
 
Here is an exemple of ''My Component''.  
 
  
 
=== Author ===
 
=== Author ===
  
 +
2009 - [[User:Joshy|Jose Mejuto]]
  
 
=== License ===
 
=== License ===
Line 24: Line 19:
  
 
=== Download ===
 
=== Download ===
The latest stable release can be found on ''link to the lazarus-ccr sf download location''.
+
The latest stable release can be found on ''link to the lazarus-ccr sf download location'' (pending).
  
 
=== Change Log ===
 
=== Change Log ===
* Version 1.0 ''date''
+
 
 +
* Version 1.0 2009.11.10
  
 
=== Dependencies / System Requirements ===
 
=== Dependencies / System Requirements ===
* None
 
  
Status: ''Stable / Alpha''
+
* [http://www.twinsun.com/tz/tz-link.htm TZ Database]
  
Issues:  
+
Status: ''Stable''
  
 +
Issues: TDateTime in fpc seems to have problems for dates before 30 Dec 1899, so the time operations before such date could be wrong. If you need to operate with early dates you can derive a new class from TPascalTZ and expose the TTZDateTime to operate with.
  
 
=== Installation ===
 
=== Installation ===
* step 1
 
* step 2
 
 
=== The ''My Component'' Example Application ===
 
  
'''Installation'''
+
* Just add the '''upascaltz''' to the uses clause of your project.
* Open TestMyComponent.lpi
+
* Load a database in a new instance of the class.
* compile
 
* run
 

Revision as of 17:20, 11 November 2009

About

PascalTZ stands for "Pascal Time Zone". It allows you to convert local times to GMT/UTC/Zulu and across time zones taking in account the different rules for this change on every time zone. PascalTZ uses the public database available at http://www.twinsun.com/tz/tz-link.htm to know how to change time for any past time (rules changed over the years) and it is almost 100% reliable for times in 20th and 21th century, and quite precise for prior times as some rules in 19th century and before were never properly documented. Time zone changes for the future times are not reliable as the rules can change sometimes suddenly like Venezuela 2007 change proposed a bunch of days before the change, or the 2009 Argentina ones.

The unit can:

  • Convert a given time/date in local time to/from GMT time.
  • Convert a given time/date across two zone times.
  • In the conversion process detect invalid times.
  • Be updateable simply upgrading the TZ Database

The download contains the component, an installation package and a demo application, that illustrates the features of the component along with some instrumentation for evaluating the component on a given system. The unit can also used in non Lazarus projects (plain fpc applications) as the unit does not require any user graphic interface but is included as a package for easy integration in applications.

Author

2009 - Jose Mejuto

License

modified LGPL (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing.

Download

The latest stable release can be found on link to the lazarus-ccr sf download location (pending).

Change Log

  • Version 1.0 2009.11.10

Dependencies / System Requirements

Status: Stable

Issues: TDateTime in fpc seems to have problems for dates before 30 Dec 1899, so the time operations before such date could be wrong. If you need to operate with early dates you can derive a new class from TPascalTZ and expose the TTZDateTime to operate with.

Installation

  • Just add the upascaltz to the uses clause of your project.
  • Load a database in a new instance of the class.