|
◆ datetime_getval()
pure subroutine datetime_class::datetime_getval |
( |
type(datetime), intent(in) |
this, |
|
|
integer, intent(out), optional |
year, |
|
|
integer, intent(out), optional |
month, |
|
|
integer, intent(out), optional |
day, |
|
|
integer, intent(out), optional |
hour, |
|
|
integer, intent(out), optional |
minute, |
|
|
integer, intent(out), optional |
msec, |
|
|
integer(kind=int_ll), intent(out), optional |
unixtime, |
|
|
character(len=*), intent(out), optional |
isodate, |
|
|
character(len=*), intent(out), optional |
simpledate, |
|
|
character(len=12), intent(out), optional |
oraclesimdate |
|
) |
| |
|
private |
Restituisce il valore di un oggetto datetime in una o pi� modalit� desiderate.
Qualsiasi combinazione dei parametri opzionali � consentita. oraclesimedate � obsoleto, usare piuttosto simpledate.
- Parametri
-
[in] | this | oggetto di cui restituire il valore |
[out] | year | anno |
[out] | month | mese |
[out] | day | giorno |
[out] | hour | ore |
[out] | minute | minuti |
[out] | msec | millisecondi |
[out] | unixtime | secondi a partire dal 1/1/1970 |
[out] | isodate | data completa nel formato AAAA-MM-GG hh:mm:ss.msc (simil-ISO), la variabile pu� essere pi� corta di 23 caratteri, in tal caso conterr� solo ci� che vi cape |
[out] | simpledate | data completa nel formato AAAAMMGGhhmmssmsc , la variabile pu� essere pi� corta di 17 caratteri, in tal caso conterr� solo ci� che vi cape, da preferire rispetto a oraclesimdate |
[out] | oraclesimdate | data parziale nel formato AAAAMMGGhhmm |
Definizione alla linea 902 del file datetime_class.F90.
903 TYPE(timedelta) :: this 905 CALL timedelta_init(this, year, month, day, hour, minute, sec, msec, & 906 isodate, simpledate, oraclesimdate) 908 END FUNCTION timedelta_new 915 SUBROUTINE timedelta_init(this, year, month, day, hour, minute, sec, msec, & 916 isodate, simpledate, oraclesimdate) 917 TYPE(timedelta), INTENT(INOUT) :: this 918 INTEGER, INTENT(IN), OPTIONAL :: year 919 INTEGER, INTENT(IN), OPTIONAL :: month 920 INTEGER, INTENT(IN), OPTIONAL :: day 921 INTEGER, INTENT(IN), OPTIONAL :: hour 922 INTEGER, INTENT(IN), OPTIONAL :: minute 923 INTEGER, INTENT(IN), OPTIONAL :: sec 924 INTEGER, INTENT(IN), OPTIONAL :: msec 925 CHARACTER(len=*), INTENT(IN), OPTIONAL :: isodate 926 CHARACTER(len=*), INTENT(IN), OPTIONAL :: simpledate 927 CHARACTER(len=12), INTENT(IN), OPTIONAL :: oraclesimdate 929 INTEGER :: n, l, lyear, lmonth, d, h, m, s, ms 930 CHARACTER(len=23) :: datebuf 934 IF ( PRESENT(isodate)) THEN 935 datebuf(1:23) = '0000000000 00:00:00.000' 936 l = len_trim(isodate) 938 n = index(trim(isodate), ' ') 940 IF (n > 11 .OR. n < l - 12) GOTO 200 941 datebuf(12-n:12-n+l-1) = isodate(:l) 943 datebuf(1:l) = isodate(1:l) 948 READ(datebuf, '(I4,I2,I4,1X,I2,1X,I2,1X,I2,1X,I3)', err=200) lyear, lmonth, d, & 950 this%month = lmonth + 12*lyear 951 this%iminuti = 86400000_int_ll*int(d, kind=int_ll) + & 952 3600000_int_ll*int(h, kind=int_ll) + 60000_int_ll*int(m, kind=int_ll) + & 953 1000_int_ll*int(s, kind=int_ll) + int(ms, kind=int_ll) 958 CALL l4f_log(l4f_error, 'isodate '//trim(isodate)// ' not valid') 961 ELSE IF ( PRESENT(simpledate)) THEN 962 datebuf(1:17) = '00000000000000000' 963 datebuf(1:min(len(simpledate),17)) = simpledate(1:min(len(simpledate),17)) 964 READ(datebuf, '(I8.8,3I2.2,I3.3)', err=220) d, h, m, s, ms 965 this%iminuti = 86400000_int_ll*int(d, kind=int_ll) + & 966 3600000_int_ll*int(h, kind=int_ll) + 60000_int_ll*int(m, kind=int_ll) + & 967 1000_int_ll*int(s, kind=int_ll) + int(ms, kind=int_ll) 971 CALL l4f_log(l4f_error, 'simpledate '//trim(simpledate)// ' not valid') 975 ELSE IF ( PRESENT(oraclesimdate)) THEN 976 CALL l4f_log(l4f_warn, 'in timedelta_init, parametro oraclesimdate '// & 977 'obsoleto, usare piuttosto simpledate') 978 READ(oraclesimdate, '(I8,2I2)')d, h, m 979 this%iminuti = 86400000_int_ll*int(d, kind=int_ll) + & 980 3600000_int_ll*int(h, kind=int_ll) + 60000_int_ll*int(m, kind=int_ll) 982 ELSE IF (.not. present(year) .and. .not. present(month) .and. .not. present(day)& 983 .and. .not. present(hour) .and. .not. present(minute) .and. .not. present(sec)& 984 .and. .not. present(msec) .and. .not. present(isodate) & 985 .and. .not. present(simpledate) .and. .not. present(oraclesimdate)) THEN 991 IF ( PRESENT(year)) THEN 993 this%month = this%month + year*12 999 IF ( PRESENT(month)) THEN
|