/***************************************************************************** * * MSO Corporation * * File : date_calc.h * Compiler : IAR C 5.30C Kickstart * Revision : $Revision: 1.0 $ * Date : $Date: 2010 / 7 / 16 * Updated by : $Author: Jongkwang Woo * * Support mail : spirit0305@naver.com * * Description : Header file for date_calc.c * ****************************************************************************/ #ifndef _DATE_CALC_H_ #define _DATE_CALC_H_ #include #define UTC_TIMESTAMP 719163 // 1970-01-01 #define UTC_YEAR 1970 // 1970-01-01 #define UTC_KOREA (u32)9 * 60 * 60 #define UTC_CHINA (u32)9 * 60 * 60 //Epoch time offset (1 January 2000 00:00:00) = 946684800 #define UTC_EPOCH_TIME_OFFSET 946684800 typedef struct _TDateTimePacket { u16 year; u16 month; u16 date; u16 hour; u16 min; u16 sec; } TDateTimePacket, *PDateTimePacket; extern void CalcTimeStampToDateTime(u32 TimeStamp, void *datetime); extern u32 CalcDay(u32 iYear, u32 iMonth, u32 iDay); extern u32 DateStampToTimeStamp(u32 DateStamp); extern void CalcDateStampToDateTime(u32 DateStamp, u8 *DateTime); extern u32 DateStrToDateStamp(u8 *DateTime); //extern void CalcTimeStampToDateTime1(u32 TimeStamp, u8 *DateTime); u32 DateTimeToTimeStamp(PDateTimePacket adate); u32 DateTimeStrToTimeStamp(u8 *DateTime); #endif