Академический Документы
Профессиональный Документы
Культура Документы
FortranLibraryReference
Previous:date:GetCurrentDateasaCharacterString Next:dtime,etime:ElapsedExecutionTime
date_and_time :GetDateandTime
ThisisaFORTRAN77versionoftheFortran90intrinsicroutine,andisYear2000safe.
calldate_and_time( date,time,zone,values )
VALUES(1) Theyear,asa4digitinteger.Forexample,1998.
VALUES(2) Themonth,asanintegerfrom1to12.
VALUES(3) Thedayofthemonth,asanintegerfrom1to31.
VALUES(4) Thetimedifference,inminutes,withrespecttoUTC.
VALUES(5) Thehouroftheday,asanintegerfrom1to23.
VALUES(6) Theminutesofthehour,asanintegerfrom1to59.
VALUES(7) Thesecondsoftheminute,asanintegerfrom0to60.
VALUES(8) Themillisecondsofthesecond,inrange0to999.
Anexampleusingdate_and_time:
demo% catdtm.f
integerdate_time(8)
character*10b(3)
calldate_and_time(b(1),b(2),b(3),date_time)
print*,'date_timearrayvalues:'
print*,'year=',date_time(1)
print*,'month_of_year=',date_time(2)
print*,'day_of_month=',date_time(3)
print*,'timedifferenceinminutes=',date_time(4)
print*,'hourofday=',date_time(5)
print*,'minutesofhour=',date_time(6)
print*,'secondsofminute=',date_time(7)
print*,'millisecondsofsecond=',date_time(8)
print*,'DATE=',b(1)
print*,'TIME=',b(2)
print*,'ZONE=',b(3)
end
WhenrunonacomputerinCalifornia,USAonJuly9,1998,itgeneratedthefollowingoutput:
date_timearrayvalues:
year=1998
month_of_year=7
day_of_month=9
timedifferenceinminutes=420
hourofday=17
minutesofhour=8
secondsofminute=54
millisecondsofsecond=587
DATE=19980709
TIME=170854.587
ZONE=0700
Previous:date:GetCurrentDateasaCharacterString Next:dtime,etime:ElapsedExecutionTime
2010,OracleCorporationand/oritsaffiliates