Convert second(s) to hour(s), minute(s), and second(s). (KCW, 2024-02-07)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | sec |
pure function sec_to_hour_min_sec(sec) result(hour_min_sec) integer, intent(in) :: sec integer :: hour_min_sec(3) ! These are all intended to be integer arithmetics. hour_min_sec(1) = sec / 3600 hour_min_sec(2) = sec / 60 - hour_min_sec(1) * 60 hour_min_sec(3) = sec - hour_min_sec(1) * 3600 - hour_min_sec(2) * 60 end function sec_to_hour_min_sec