wavebitscientific / datetime-fortran

Date and time manipulation for modern Fortran
MIT License
137 stars 50 forks source link

Timezone handling #1

Open milancurcic opened 11 years ago

milancurcic commented 11 years ago

datetime-fortran currently provides no timezone information in the datetime class definition. I believe timezone handling should be implemented as an optional derived type which is a component of datetime:

TYPE :: datetime

    ...

    TYPE :: tz
        ! tz components
    ENDTYPE tz

ENDTYPE datetime

A possible timezone model may the one from Python: http://docs.python.org/2/library/datetime.html#tzinfo-objects

milancurcic commented 8 years ago

Time zones, daylight saving times, and leap seconds, all difficult to handle and important for tracking time in Gregorian calendar.

Current time zone capabilities in datetime-fortran are very basic - essentially a floating-point timezone offset is available as a component to datetime object, but must be controlled by user.

The IANA timezone database provides access to data and C code that handle all time zones, DSTs, and leap seconds in the past.

datetime-fortran should be able to interface this database, or at least a subset of it, for more complete timezone handling.