File: time.c

package info (click to toggle)
putty 0.74-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,020 kB
  • sloc: ansic: 114,140; python: 4,372; perl: 3,511; sh: 1,563; makefile: 167
file content (16 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (27)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}