Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #pragma pack (push,1)
- typedef struct{
- unsigned Sec :5;
- unsigned Min :6;
- unsigned Hour :5;
- unsigned Day :5;
- unsigned Month :4;
- unsigned Year :7;
- }FatDate_t;
- #pragma pack (pop)
- DWORD get_fattime(DWORD UNIX_timestemp){
- time_t rawtime;
- struct tm * timeinfo;
- rawtime=UNIX_timestemp;
- timeinfo = localtime (&rawtime);
- DWORD FatDate=0;
- FatDate_t *FDate=(FatDate_t *)&FatDate;
- FDate->Sec=timeinfo->tm_sec>>1;
- FDate->Min=timeinfo->tm_min;
- FDate->Hour=timeinfo->tm_hour;
- FDate->Day=timeinfo->tm_mday;
- FDate->Month=timeinfo->tm_mon+1;
- FDate->Year=timeinfo->tm_year+48;
- return FatDate;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement