* Re: g77/F90 date_and_time() intrinsic
@ 1999-01-22 0:42 N8TM
1999-01-24 8:46 ` Dave Love
1999-01-31 23:58 ` N8TM
0 siblings, 2 replies; 5+ messages in thread
From: N8TM @ 1999-01-22 0:42 UTC (permalink / raw)
To: K.Maguire, egcs; +Cc: dave, tprince
If you're using f90, you won't be getting the same version of date_and_time
which you get with g77 alone. I bear some responsibility for the latter,
having persuaded Dave Love to include it in libU77. The g77 version, of
course, doesn't deal with key words, but if it has other problems, I'll try to
fix them.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: g77/F90 date_and_time() intrinsic
1999-01-22 0:42 g77/F90 date_and_time() intrinsic N8TM
@ 1999-01-24 8:46 ` Dave Love
1999-01-31 23:58 ` Dave Love
1999-01-31 23:58 ` N8TM
1 sibling, 1 reply; 5+ messages in thread
From: Dave Love @ 1999-01-24 8:46 UTC (permalink / raw)
To: egcs
>>>>> "Tim" == Tim Prince <N8TM@aol.com> writes:
Tim> If you're using f90, you won't be getting the same version of
Tim> date_and_time which you get with g77 alone. I bear some
Tim> responsibility for the latter, having persuaded Dave Love to
Tim> include it in libU77. The g77 version, of course, doesn't deal
Tim> with key words, but if it has other problems, I'll try to fix
Tim> them.
Of course it doesn't have keywords with g77. I'm afarid I don't
undertsand the problem. What's wrong with it since I fixed the thinko
Kevin reported? [FWIW, I didn't need persuading to include it, but it
was sidelined pending portability issues and probably still doesn't
provide millisecond data on many non-GNU systems where it might.]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: g77/F90 date_and_time() intrinsic
1999-01-22 0:42 g77/F90 date_and_time() intrinsic N8TM
1999-01-24 8:46 ` Dave Love
@ 1999-01-31 23:58 ` N8TM
1 sibling, 0 replies; 5+ messages in thread
From: N8TM @ 1999-01-31 23:58 UTC (permalink / raw)
To: K.Maguire, egcs; +Cc: dave, tprince
If you're using f90, you won't be getting the same version of date_and_time
which you get with g77 alone. I bear some responsibility for the latter,
having persuaded Dave Love to include it in libU77. The g77 version, of
course, doesn't deal with key words, but if it has other problems, I'll try to
fix them.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: g77/F90 date_and_time() intrinsic
1999-01-24 8:46 ` Dave Love
@ 1999-01-31 23:58 ` Dave Love
0 siblings, 0 replies; 5+ messages in thread
From: Dave Love @ 1999-01-31 23:58 UTC (permalink / raw)
To: egcs
>>>>> "Tim" == Tim Prince <N8TM@aol.com> writes:
Tim> If you're using f90, you won't be getting the same version of
Tim> date_and_time which you get with g77 alone. I bear some
Tim> responsibility for the latter, having persuaded Dave Love to
Tim> include it in libU77. The g77 version, of course, doesn't deal
Tim> with key words, but if it has other problems, I'll try to fix
Tim> them.
Of course it doesn't have keywords with g77. I'm afarid I don't
undertsand the problem. What's wrong with it since I fixed the thinko
Kevin reported? [FWIW, I didn't need persuading to include it, but it
was sidelined pending portability issues and probably still doesn't
provide millisecond data on many non-GNU systems where it might.]
^ permalink raw reply [flat|nested] 5+ messages in thread
* g77/F90 date_and_time() intrinsic
@ 1999-01-31 23:58 Kevin Maguire
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Maguire @ 1999-01-31 23:58 UTC (permalink / raw)
To: egcs; +Cc: dave
Hi
Consider the following: (egcs-1.1.1 Linux/x86)
% cat egcs-timer.f
character*8 dt
character*10 tm
character*5 zn
integer tt(8)
CALL Date_and_Time(dt,tm,zn,tt)
print *,dt
print *,tm
print *,zn
print *,tt
end
% g77 egcs-timer.f
% ./a.out
19990115
111938.953
+0000
1999 1 15 0 11 19 38 953109
^^^^^^
% ./a.out
19990115
112017.207
+0000
1999 1 15 0 11 20 17 207858
^^^^^^
The F90 standard says something like:
VALUE(8) : the milliseconds, in the range 0 to 999, or -HUGE(0) if there
is no clock.
There is a clock, and I see in datetime_.c
vals[7] = 0; /* no STDC way to get this */
/* GNUish way; maybe use `ftime' on other systems. */
#if HAVE_GETTIMEOFDAY
{
struct timeval tp;
struct timezone tzp;
if (! gettimeofday (&tp, &tzp))
vals[7] = tp.tv_usec;
}
#endif
My man page says for gettimeofday:
int gettimeofday(struct timeval *tv, struct timezone *tz);
#include <sys/time.h>
#include <unistd.h>
gettimeofday and settimeofday can set the time as well as a timezone.
tv is a timeval struct, as specified in /usr/include/sys/time.h:
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
So don't we need to convert this to milliseconds to satisfy the
standard.
Incidentally the egcs/g77 info doc says the same thing:
---
VALUES
The year, month of the year, day of the month, time difference in
minutes from UTC, hour of the day, minutes of the hour and
milliseconds of the second in successive values of the array.
On systems where a millisecond timer isn't available, the millisecond
value is returned as zero.
---
Cheers
Kevin
--
/\___/\ ==============================================
| o o | Kevin Maguire Computational Scientist
__\_^_/__ DCI CLRC Daresbury Laboratory
(__/ \__) e-mail: K.Maguire@dl.ac.uk
_| : |_ Tel: 01925 603221 Fax: 01925 603634
(__\___/__) ==============================================
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-01-31 23:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-22 0:42 g77/F90 date_and_time() intrinsic N8TM
1999-01-24 8:46 ` Dave Love
1999-01-31 23:58 ` Dave Love
1999-01-31 23:58 ` N8TM
1999-01-31 23:58 Kevin Maguire
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).