dongli / fortran-datetime

Another Fortran datetime library
14 stars 7 forks source link
datetime fortran-library

Fortran Date Time Library

Content

Overview

This is a Fortran datetime library for doing tedious datetime operations.

Go to Top

Installation

A CMake-Setup is provided.

Go to Top

Example

use datetime

type(datetime_type) a, b
type(timedelta_type) dt

a = datetime(year=2017, month=10, day=6, hour=14)

write(6, *) a%isoformat() ! => 2017-10-06T14:00:00Z

dt = timedelta(minutes=6)
b = a + dt

write(6, *) a%isoformat() ! => 2017-10-06T14:06:00Z

b = datetime(year=2018, month=4, day=16, hour=23, minute=51)

dt = b - a

write(6, *) dt%total_seconds() ! => 16624260.0
write(6, *) dt%total_minutes() ! => 277071.0
write(6, *) dt%total_hours()   ! => 4617.85
write(6, *) dt%total_days()    ! => 192.4104166666667

Compiler Support

[Compiler]() [Compiler]() [Compiler]() [Compiler]() [Compiler]() [Compiler]()

Go to Top

License

[License]()

Go to Top