cen64/os/common/local_time.h
Mike Ryan a7f52a5e2c time: move get_local_time out to platform-specific dir
Patched DD code to make use of this code. Untested on Windows.
2016-02-03 21:26:36 -08:00

38 lines
646 B
C

//
// os/common/local_time.h
//
// Functions for getting current time.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#ifndef __os_local_time_h__
#define __os_local_time_h__
#include "common.h"
#include <stddef.h>
#ifdef _WIN32
#include <windows.h>
#endif
struct time_stamp {
unsigned year;
unsigned month;
unsigned day;
unsigned hour;
unsigned min;
unsigned sec;
unsigned week_day;
};
void get_local_time(struct time_stamp *ts);
static inline uint8_t byte2bcd(unsigned byte) {
byte %= 100;
return ((byte / 10) << 4) | (byte % 10);
}
#endif