checking in all the old panacean stuff
This commit is contained in:
16
puttysrc/TIME.C
Normal file
16
puttysrc/TIME.C
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Portable implementation of ltime() for any ISO-C platform where
|
||||
* time_t behaves. (In practice, we've found that platforms such as
|
||||
* Windows and Mac have needed their own specialised implementations.)
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <assert.h>
|
||||
|
||||
struct tm ltime(void)
|
||||
{
|
||||
time_t t;
|
||||
time(&t);
|
||||
assert (t != ((time_t)-1));
|
||||
return *localtime(&t);
|
||||
}
|
||||
Reference in New Issue
Block a user