File: time.c

package info (click to toggle)
its-playback-time 0.2017-08-30.3c40fd3-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 888 kB
  • sloc: ansic: 15,449; perl: 197; makefile: 29; sh: 1
file content (16 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (21)
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);
}