Design Pattern Examples
Overview of object-oriented design patterns
helpers/DateTime.h File Reference

Declaration of the DateTime functions, datetime_to_string() and datetime_now(), to simplify getting the local time as a string. More...

#include <time.h>
Include dependency graph for helpers/DateTime.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __DATETIME_H__
 

Functions

const char * datetime_to_string (time_t timestamp)
 Convert the specified time stamp to a string.
 
time_t datetime_now (void)
 Retrieve a time stamp that represents the current time.
 

Detailed Description

Declaration of the DateTime functions, datetime_to_string() and datetime_now(), to simplify getting the local time as a string.

Definition in file helpers/DateTime.h.

Macro Definition Documentation

◆ __DATETIME_H__

#define __DATETIME_H__

Definition at line 8 of file helpers/DateTime.h.

Function Documentation

◆ datetime_now()

time_t datetime_now ( void  )

Retrieve a time stamp that represents the current time.

Returns
A time_t value representing the current time.

Definition at line 27 of file datetime.c.

Referenced by _ConstructTree(), and _GetTimeStamp().

◆ datetime_to_string()

const char * datetime_to_string ( time_t  timestamp)

Convert the specified time stamp to a string.

Parameters
timestampA time_t value representing the time stamp.
Returns
Returns a string representation of the time stamp. The pointer is valid until the next time this function is called.

Definition at line 12 of file datetime.c.

References makelocaltime().

Referenced by _GetTimeStamp(), and Composite_Exercise_FormatEntry().