aboutsummaryrefslogtreecommitdiff
path: root/libutil/op_get_time.c
blob: c094c6380c174f245c02225b96a95ac40c496a78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * @file op_get_time.c
 * Get current time as a string
 *
 * @remark Copyright 2002 OProfile authors
 * @remark Read the file COPYING
 *
 * @author John Levon
 * @author Philippe Elie
 */

#include "op_get_time.h"

#include <time.h>

char * op_get_time(void)
{
	time_t t = time(NULL);

	if (t == -1)
		return "";

	return ctime(&t);
}