[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getting the time....
From: |
Ginger Booth |
Subject: |
getting the time.... |
Date: |
Mon, 17 Mar 97 12:08:51 EST |
Hi, Swarmfolk,
I have a Not-Deep problem. I want to simply get the current time string
(the date, in English) to add as a comment to my output files (Program Version
Ran Date). On my system, the following works:
char* timeString()
{
// there ought to be an easier way....
int timeofday;
struct timeval tp;
timeofday = gettimeofday (&tp, (struct timezone *) 0);
return( ctime ( &tp.tv_sec));
}
But apparently this isn't very portable. I don't care how I do it, but feel
it needs to be done. What's a "standard" Unix way to do it?
Thanks!
Ginger
- getting the time....,
Ginger Booth <=