|
运行执行程序获取日期时间有8个小时时差:
.........
Call timestamp()
.........
Subroutine timestamp()
!*********************************************************************72
!
!c TIMESTAMP prints out the current YMDHMS date as a timestamp.
!
! Parameters:
!
! None
!
Implicit None
Character *(8) ampm
Integer d
Character *(8) date
Integer h
Integer m
Integer mm
Character *(9) month(12)
Integer n
Integer s
Character *(10) time
Integer y
Save month
Data month/'January ', 'February ', 'March ', 'April ', 'May ',&
'June ', 'July ', 'August ', 'September', 'October ', &
'November ', 'December '/
Call date_and_time(date, time)
Read (date, '(i4,i2,i2)') y, m, d
Read (time, '(i2,i2,i2,1x,i3)') h, n, s, mm
If (h<12) Then
ampm = 'AM'
Else If (h==12) Then
If (n==0 .And. s==0) Then
ampm = 'Noon'
Else
ampm = 'PM'
End If
Else
h = h - 12
If (h<12) Then
ampm = 'PM'
Else If (h==12) Then
If (n==0 .And. s==0) Then
ampm = 'Midnight'
Else
ampm = 'AM'
End If
End If
End If
Write (*, '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)') d, &
month(m), y, h, ':', n, ':', s, '.', mm, ampm
Return
End Subroutine timestamp
.......
.......
29 May 2023 8:41:23.777 AM
NAS:
FORTRAN95,2013&18 version
The NAS kernel benchmark program
Program Error FP Ops Seconds MFLOPS
MXM 3.4313E-15 4.1943E+08 0.5338 785.70
CFFT2D 1.3326E-13 4.9807E+08 0.6031 825.91
CHOLSKY 2.8784E-12 2.2103E+08 0.5641 391.84
BTRIX 2.5033E-13 3.2197E+08 0.5741 560.85
GMTRY 1.8918E-13 2.2650E+08 0.4510 502.21
EMIT 2.0694E-15 2.2604E+08 0.0991 2281.00
...........
29 May 2023 8:41:27.221 AM
...Program finished with exit code 0
Press ENTER to exit console.
*********************************************
我的位置中国大陆广州, 目前日期时间: 20230529 16:49
足足八个小时时差,???
盼复! 谢谢!
|
|