dongli / fortran-datetime

Another Fortran datetime library
14 stars 7 forks source link

negative timedelta_type #4

Open mpagowski opened 5 years ago

mpagowski commented 5 years ago

Pls look at the code below dt is always positive regardless of the sign. Is there a way to allow negative values? Thanks

TYPE(timedelta_type) :: dt

PRINT *,fcstdate%isoformat()
PRINT *,aod_nnr_record(1)%obsdate%isoformat()
PRINT *,aod_nnr_record(30000)%obsdate%isoformat()

dt=aod_nnr_record(1)%obsdate-fcstdate
PRINT *,dt

dt=aod_nnr_record(30000)%obsdate-fcstdate
PRINT *,dt

2015-08-05T21:00:00Z
2015-08-05T19:31:00Z
2015-08-05T21:22:00Z
0 1 29 0 0 0 0 22 0 0

dongli commented 5 years ago

Okay, I will check it later.

dongli commented 5 years ago

@mpagowski Sorry for the delay! I have fixed the problem, you could give it a try.

mpagowski commented 5 years ago

Thanks, works great, but please update the example because of different module/function names

On Oct 18, 2018, at 9:40 PM, Li Dong notifications@github.com wrote:

@mpagowski https://github.com/mpagowski Sorry for the delay! I have fixed the problem, you could give it a try.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dongli/fortran-datetime/issues/4#issuecomment-431235305, or mute the thread https://github.com/notifications/unsubscribe-auth/AV1PSyDUQAsGNsruIxbCa8-p_qXOCuVzks5umUmbgaJpZM4XZvFP.

dongli commented 5 years ago

@mpagowski I will find another time to update README.md.