BUG: DATE_AND_TIME Returns Zero for the Milliseconds ValueLast reviewed: February 29, 1996Article ID: Q147755 |
The information in this article applies to:
SYMPTOMSWhen you use the VALUES array parameter of the DATE_AND_TIME subroutine, zero is returned from the system clock to the milliseconds array element.
RESOLUTIONUse the TIME parameter to the DATE_AND_TIME subroutine, or use the GETTIM() subroutine, which is accurate up to one-hundredths of a second.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Sample Code to Illustrate Problem and WorkaroundsC Compile options needed: none
USE MSFLIB INTEGER(4) CURTIME(8) C CHARACTER*10 TIME_STR ! Uncomment for Workaround #1C INTEGER(2) THOUR, TMIN, TSEC, THUN ! Uncomment for Workaround #2
CALL DATE_AND_TIME(VALUES=CURTIME) ! Returns zero milliseconds. WRITE(*,*) 'Using DATE_AND_TIME().' WRITE(*, 100) CURTIME(5), CURTIME(6), CURTIME(7), CURTIME(8) WRITE(*,*)C Uncomment the following two lines for Workaround #1 C CALL DATE_AND_TIME(TIME=TIME_STR) C WRITE(*,*) 'The current time is: ', TIME_STR C Uncomment the following three lines for Workaround #2 C WRITE(*,*) ; WRITE(*,*) 'Using GETTIM().' C CALL GETTIM(THOUR, TMIN, TSEC, THUN) C WRITE(*, 100) THOUR, TMIN, TSEC, THUN*10 100 FORMAT(' The current time is: ', I2.2, ':', I2.2, ':', + I2.2, '.', I3.3) END |
Additional reference words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |