Home > Archive > Fortran > July 2004 > TIME()
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Brian Lepore 2004-07-16, 8:58 pm |
| Does anyone know how to call the current time in gnu f77 with gcc? I have
tried a bunch of stuff.
| |
| John Wingate 2004-07-16, 8:58 pm |
| Brian Lepore <bjlepore@wisc.edu> wrote:
> Does anyone know how to call the current time in gnu f77 with gcc? I have
> tried a bunch of stuff.
You can use the FDATE intrinsic subroutine:
$ cat xxx.f
program dattim
character*24 d_and_t
call fdate(d_and_t)
print *, d_and_t
print *, d_and_t(12:19)
end
$ g77 -o xxx xxx.f
$ ./xxx
Fri Jul 16 20:35:50 2004
20:35:50
--
John Wingate Mathematics is the art which teaches
johnww@worldpath.net one how not to make calculations.
--Oscar Chisini
| |
| Tim Prince 2004-07-17, 3:57 pm |
|
"John Wingate" <johnww@worldpath.net> wrote in message
news:10fgtknb2sk918d@corp.supernews.com...
> Brian Lepore <bjlepore@wisc.edu> wrote:
have[color=darkred]
>
> You can use the FDATE intrinsic subroutine:
>
As g77 supports DATE_AND_TIME(), minus keywords, you could use that and
avoid departing from Fortran. Try 'info g77' or any textbook of the last 15
years, or see the examples which come with g77:
call date_and_time(ddate) ! omitting optional args
call date_and_time(ddate, ttime, zone, values)
write(6, *) 'DATE_AND_TIME returns: ', ddate, ' ', ttime, ' ',
+ zone, ' ', values
| |
| John Wingate 2004-07-17, 3:57 pm |
| Tim Prince <tprince@nospamcomputer.org> wrote:
> "John Wingate" <johnww@worldpath.net> wrote in message
> news:10fgtknb2sk918d@corp.supernews.com...
> As g77 supports DATE_AND_TIME(), minus keywords, you could use that and
> avoid departing from Fortran. Try 'info g77' or any textbook of the last 15
> years, or see the examples which come with g77:
That's good to know. I failed to find the full table of intrinsics in the
info file.
--
John Wingate Mathematics is the art which teaches
johnww@worldpath.net one how not to make calculations.
--Oscar Chisini
|
|
|
|
|