construct_ISO8601DateTime Function

public function construct_ISO8601DateTime(isostring, rc) result(datetime)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: isostring
integer, intent(inout), optional :: rc

Return Value type(ISO8601DateTime)


Calls

proc~~construct_iso8601datetime~~CallsGraph proc~construct_iso8601datetime construct_ISO8601DateTime interface~mapl_assert MAPL_Assert proc~construct_iso8601datetime->interface~mapl_assert proc~mapl_return MAPL_Return proc~construct_iso8601datetime->proc~mapl_return proc~mapl_verify MAPL_Verify proc~construct_iso8601datetime->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~construct_iso8601datetime~~CalledByGraph proc~construct_iso8601datetime construct_ISO8601DateTime interface~iso8601datetime ISO8601DateTime interface~iso8601datetime->proc~construct_iso8601datetime proc~test_construct_iso8601datetime test_construct_ISO8601DateTime proc~test_construct_iso8601datetime->proc~construct_iso8601datetime

Source Code

   function construct_ISO8601DateTime(isostring, rc) result(datetime)
      character(len=*), intent(in) :: isostring
      integer, optional, intent(inout) :: rc
      type(ISO8601DateTime) :: datetime
      character, parameter :: DELIMITER = TIME_PREFIX
      integer :: status
      integer :: time_index = 0
      time_index = index(isostring,TIME_PREFIX)
      if(time_index > 0) then
         datetime%date_ = ISO8601Date(isostring(1:time_index-1), _RC)
         datetime%time_ = ISO8601Time(isostring(time_index:len(isostring)), _RC)
         _RETURN(_SUCCESS)
      else
         _FAIL('Invalid ISO 8601 datetime string')
      end if
   end function construct_ISO8601DateTime