now Function

public function now() result(dt)

Return the current local date and time.

Arguments

None

Return Value type(datetime_type)


Source Code

    function now() result(dt)
        !! version: experimental
        !!
        !! Return the current local date and time.
        type(datetime_type) :: dt
        integer :: v(8)
        call date_and_time(values=v)
        dt = datetime_type(v(1), v(2), v(3), v(5), &
                           v(6), v(7), v(8), v(4))
    end function now