Files
redAcore/DateTimeCore.h
Charl Wentzel bc89021a0e Important Update:
- DateTimeCore:
  - Added new functions to process data information
- JSONparse:
  - Bug fix: file permissions on create
2019-04-03 17:03:50 +02:00

42 lines
1.6 KiB
C

/*
* DateTimeCore.h
*
* Created on: 3 Mar 2017
* Author: wentzelc
*/
#ifndef REDACORE_DATETIMECORE_H_
#define REDACORE_DATETIMECORE_H_
// Standard C/C++ Libraries
#include <cstdlib>
// redA Libraries
/* none */
//---------------------------------------------------------------------------
// Get and set System Date and Time
bool SetTime( unsigned char Hours, unsigned char Minutes, unsigned char Seconds );
bool GetTime( unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool SetDate( unsigned char Day, unsigned char Month, unsigned Year );
bool GetDate( unsigned char &Day, unsigned char &Month, unsigned &Year );
char const * GetDateStr( const char * DateSeparator = "/" );
char const * GetTimeStr( const char * TimeSeparator = ":" );
char const * GetDateTimeStr( const char * DateSeparator = "/", const char * TimeSeparator = ":" );
//---------------------------------------------------------------------------
bool ReadTime( const time_t EpochTime, unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool ReadDate( const time_t EpochTime, unsigned char &Day, unsigned char &Month, unsigned &Year );
char const * BuildDateStr( const time_t EpochTime, const char * DateSeparator = "/" );
char const * BuildTimeStr( const time_t EpochTime, const char * TimeSeparator = ":" );
char const * BuildDateTimeStr( const time_t EpochTime, const char * DateSeparator = "/", const char * TimeSeparator = ":" );
//---------------------------------------------------------------------------
#endif /* REDACORE_DATETIMECORE_H_ */