construct_ISO8601Date Function

public function construct_ISO8601Date(isostring, rc) result(date)

Arguments

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

Return Value type(ISO8601Date)


Calls

proc~~construct_iso8601date~~CallsGraph proc~construct_iso8601date construct_ISO8601Date interface~mapl_assert MAPL_Assert proc~construct_iso8601date->interface~mapl_assert proc~mapl_return MAPL_Return proc~construct_iso8601date->proc~mapl_return proc~parse_date parse_date proc~construct_iso8601date->proc~parse_date 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~is_valid_date~2 is_valid_date proc~parse_date->proc~is_valid_date~2 proc~read_whole_number read_whole_number proc~parse_date->proc~read_whole_number proc~undelimit undelimit proc~parse_date->proc~undelimit proc~get_month_end get_month_end proc~is_valid_date~2->proc~get_month_end proc~is_between is_between proc~is_valid_date~2->proc~is_between proc~is_valid_month is_valid_month proc~is_valid_date~2->proc~is_valid_month proc~is_valid_year is_valid_year proc~is_valid_date~2->proc~is_valid_year proc~read_whole_number_indexed read_whole_number_indexed proc~read_whole_number->proc~read_whole_number_indexed proc~get_month_ends get_month_ends proc~get_month_end->proc~get_month_ends proc~is_valid_month->proc~is_between proc~is_valid_year->proc~is_between proc~get_integer_digit_from_string get_integer_digit_from_string proc~read_whole_number_indexed->proc~get_integer_digit_from_string proc~is_whole_number is_whole_number proc~read_whole_number_indexed->proc~is_whole_number

Called by

proc~~construct_iso8601date~~CalledByGraph proc~construct_iso8601date construct_ISO8601Date interface~iso8601date ISO8601Date interface~iso8601date->proc~construct_iso8601date

Source Code

   function construct_ISO8601Date(isostring, rc) result(date)
      character(len=*), intent(in) :: isostring
      integer, intent(out) :: rc
      type(ISO8601Date) :: date
      type(date_fields) :: fields
      fields = parse_date(trim(adjustl(isostring)))
      if(fields%is_valid_) then
         date%year_ = fields%year_
         date%month_ = fields%month_
         date%day_ = fields%day_
      else
         _FAIL('Invalid ISO 8601 date string')
      end if

      _RETURN(_SUCCESS)

   end function construct_ISO8601Date