63 character(STRING):: result
64 integer,
intent(in):: year
65 integer,
intent(in):: month
66 integer,
intent(in):: day
67 integer,
intent(in):: hour
68 integer,
intent(in):: min
69 real(
dp),
intent(in):: sec
70 character(*),
intent(in),
optional:: zone
72 character(STRING):: csec
73 character(TOKEN):: zonew
76 if (
present(zone) )
then
84 if ( trim(csec) ==
'-0.' ) csec =
'0.'
85 do while ( index(
'123456789.', csec(len_trim(csec):len_trim(csec)) ) == 0 )
86 if ( len_trim(csec) < 2 )
exit
87 csec = csec(1:len_trim(csec)-1)
89 if (int(sec) > -1 .and. int(sec) < 10)
then
90 if (len_trim(csec) >= len(csec))
then
91 csec =
'0' // trim(csec(1:len(csec) - 1))
93 csec =
'0' // trim(csec)
96 csec_len = len(trim(adjustl(csec)))
97 if (csec(csec_len:csec_len) ==
'.') csec = csec(1:csec_len-1)
99 result =
cprintf(
'%04d-%02d-%02dT%02d:%02d:%c%c', &
100 & i=(/year, month, day, hour, min/), &
101 & c1=trim(csec), c2=trim(zonew))
character(string) function dccaldatetochar1(year, month, day, hour, min, sec, zone)
Convert date into a string.