Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このように「1985-01-01-00:00」という文字として宣言された日時の値があり、年、月、日を整数として抽出したいと考えています。FORTRAN 言語の正確なコマンドがわかりません。
例えば:
program zz character(20) :: ch = "1985-01-01-00:00" integer yyyy,mm,dd read(ch(1:4),'(i)') yyyy read(ch(6:7),'(i)') mm read(ch(9:10),'(i)') dd write(*,*) yyyy, mm, dd end program zz