48 '$Id: DateTime_Utility.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 49 INTEGER,
PARAMETER ::
nl = 20
60 INTEGER :: utc_delta = 0
64 INTEGER :: millisecond = 0
67 CHARACTER(NL) :: day_name
98 CALL date_and_time(values=values)
99 datetime%Year = values(1)
100 datetime%Month = values(2)
101 datetime%Day = values(3)
102 datetime%UTC_Delta = values(4)
103 datetime%Hour = values(5)
104 datetime%Minute = values(6)
105 datetime%Second = values(7)
106 datetime%Millisecond = values(8)
181 doy =
dayofyear( datetime%Day, datetime%Month, datetime%Year )
216 n_days =
daysinmonth( datetime%Month, datetime%Year )
250 CHARACTER(NL) :: name
286 CHARACTER(NL) :: name
287 name =
dayofweek( datetime%Day, datetime%Month, datetime%Year )
315 WRITE(*,
'(1x,"DateTime OBJECT")')
316 WRITE(*,
'(3x,"Year : ",i0)') self%Year
317 WRITE(*,
'(3x,"Month : ",i0)') self%Month
318 WRITE(*,
'(3x,"Day : ",i0)') self%Day
319 WRITE(*,
'(3x,"UTC_Delta : ",i0)') self%UTC_Delta
320 WRITE(*,
'(3x,"Hour : ",i0)') self%Hour
321 WRITE(*,
'(3x,"Minute : ",i0)') self%Minute
322 WRITE(*,
'(3x,"Second : ",i0)') self%Second
323 WRITE(*,
'(3x,"Millisecond : ",i0)') self%Millisecond
324 WRITE(*,
'(3x,"DoY : ",i0)') self%DoY
325 WRITE(*,
'(3x,"Month_Name : ",a)') trim(self%Month_Name)
326 WRITE(*,
'(3x,"Day_Name : ",a)') trim(self%Day_Name)
388 CHARACTER(*) ,
OPTIONAL,
INTENT(IN) :: format
390 CHARACTER(80) :: string
392 CHARACTER(1) :: string_format
397 IF (
PRESENT(format) ) string_format = trim(adjustl(format))
402 SELECT CASE(string_format)
405 WRITE(string,
'(i2.2,"/",i2.2,"/",i4)') &
406 datetime%Month, datetime%Day, datetime%Year
409 WRITE(string,
'(a,", ",a,1x,i0,", ",i4)') &
412 datetime%Day, datetime%Year
415 WRITE(string,
'(a,", ",a,1x,i0,", ",i4,1x,i2.2,":",i2.2)') &
418 datetime%Day, datetime%Year, &
419 datetime%Hour, datetime%Minute
422 WRITE(string,
'(a,", ",a,1x,i0,", ",i4,1x,i2.2,":",i2.2,":",i2.2)') &
425 datetime%Day, datetime%Year, &
426 datetime%Hour, datetime%Minute, datetime%Second
429 WRITE(string,
'(i2.2,"/",i2.2,"/",i4,1x,i2.2,":",i2.2)') &
430 datetime%Month, datetime%Day, datetime%Year, &
431 datetime%Hour, datetime%Minute
434 WRITE(string,
'(i2.2,"/",i2.2,"/",i4,1x,i2.2,":",i2.2,":",i2.2)') &
435 datetime%Month, datetime%Day, datetime%Year, &
436 datetime%Hour, datetime%Minute, datetime%Second
439 WRITE(string,
'(a,1x,i0)') &
443 seconds =
REAL(DateTime%Second,fp) + &
444 REAL(datetime%millisecond,
fp)*1.0e-03_fp
445 WRITE(string,
'(i4,"-",i2.2,"-",i2.2,"T",i2.2,":",i2.2,":",f10.7)') &
446 datetime%Year, datetime%Month, datetime%Day, &
447 datetime%Hour, datetime%Minute, seconds
450 string =
'RFC1123 format not yet implemented' 453 WRITE(string,
'(i4,"-",i2.2,"-",i2.2,"T",i2.2,":",i2.2,":",i2.2)') &
454 datetime%Year, datetime%Month, datetime%Day, &
455 datetime%Hour, datetime%Minute, datetime%Second
458 WRITE(string,
'(i2.2,":",i2.2)') &
459 datetime%Hour, datetime%Minute
462 WRITE(string,
'(i2.2,":",i2.2,":",i2.2)') &
463 datetime%Hour, datetime%Minute, datetime%Second
466 string =
'Universal Sortable format not yet implemented' 469 string =
'Universal Full format not yet implemented' 472 WRITE(string,
'(a,", ",i4)') &
475 string =
'Invalid DateTime string format!'
elemental integer function, public datetime_dayofyear(DateTime)
elemental character(nl) function, public datetime_dayofweek(DateTime)
elemental logical function, public isleapyear(Year)
character(len=9) function, public month_name(n)
integer, parameter, public fp
elemental logical function, public datetime_isleapyear(DateTime)
elemental character(nl) function, public dayofweek(Day, Month, Year)
character(*), parameter module_version_id
elemental integer function, public dayofyear(Day, Month, Year)
type(datetime_type) function, public datetime_now()
elemental character(80) function, public datetime_tostring(DateTime, Format)
elemental character(nl) function, public nameofmonth(Month)
elemental character(nl) function, public datetime_nameofmonth(DateTime)
elemental integer function, public datetime_daysinmonth(DateTime)
elemental integer function, public daysinmonth(Month, Year)
subroutine, public datetime_inspect(self)