Clicky

Fortran Wiki
date_and_time (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #2 to #3: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

date_and_time(date, time, zone, values) gets the corresponding date and time information from the real-time system clock. date is intent(out) and has form ccyymmdd. time is intent(out) and has form hhmmss.sss. zone is intent(out) and has form (+-)hhmm, representing the difference with respect to Coordinated Universal Time (UTC). Unavailable time and date parameters return blanks.

values is intent(out) and provides the following:

  • value(1): - The year
  • value(2): - The month
  • value(3): - The day of the month
  • value(4): - Time difference with UTC in minutes
  • value(5): - The hour of the day
  • value(6): - The minutes of the hour
  • value(7): - The seconds of the minute
  • value(8): - The milliseconds of the second

Standard

Fortran 95 and later

Class

Subroutine

Syntax

(削除)

call date_and_time([date, time, zone, values])

(削除ここまで)
(追記)
call date_and_time([date, time, zone, values])
(追記ここまで)

Arguments

  • date - (Optional) The type shall be character(len=8) or larger, and of default kind.
  • time - (Optional) The type shall be character(len=10) or larger, and of default kind.
  • zone - (Optional) The type shall be character(len=5) or larger, and of default kind.
  • values- (Optional) The type shall be integer(8).

Return value

None

Example

program test_time_and_date
 character(8) :: date
 character(10) :: time
 character(5) :: zone
 integer,dimension(8) :: values
 ! using keyword arguments
 call date_and_time(date,time,zone,values)
 call date_and_time(DATE=date,ZONE=zone)
 call date_and_time(TIME=time)
 call date_and_time(VALUES=values)
 print '(a,2x,a,2x,a)', date, time, zone
 print (削除) '(8i5))' (削除ここまで)(追記) '(8i5)' (追記ここまで), values
end program test_time_and_date

See also

cpu_time, system_clock

category: intrinsics

Revised on April 4, 2016 12:59:15 by Jason Blevins (128.146.137.52) (1893 characters / 0.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Code, Intrinsic procedures, cpu_time, system_clock

AltStyle によって変換されたページ (->オリジナル) /