MoreDateTime.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "MorePrefix.h"
00018 #include "MoreDateTime.h"
00019 #include "MorePrivate.h"
00020
00021 #include <ErrorMgr.h>
00022
00023
00024
00025 void MTimeDateTimeToDate( const DateTimeType* dateTime, DateType *date )
00026 {
00027 _check( dateTime && date );
00028 date->day = dateTime->day;
00029 date->month = dateTime->month;
00030 date->year = dateTime->year - firstYear;
00031 }
00032
00033
00034
00035 void MTimeYMDtoDateType( DateType *date, UInt16 year, UInt16 month,
00036 UInt16 day )
00037 {
00038 _check( date );
00039 date->day = day;
00040 date->month = month;
00041 date->year = year - firstYear;
00042 }
00043
00044
00045
00046 void MTimeDateTypeToYMD( const DateType *date, UInt16 *year, UInt16 *month,
00047 UInt16 *day )
00048 {
00049 _check( date );
00050 if ( year )
00051 *year = date->year + firstYear;
00052 if ( month )
00053 *month = date->month;
00054 if ( day )
00055 *day = date->day;
00056 }