kolibrios/programs/system/shell/cmd_date.c
Kirill Lipatov (Leency) 939f824d96 Shell 0.4 from Albom
git-svn-id: svn://kolibrios.org@959 a494cfbc-eb01-0410-851d-a64ba20cac60
2008-12-14 11:55:46 +00:00

23 lines
512 B
C

void cmd_date()
{
unsigned date;
unsigned time;
date = kol_system_date_get();
printf(" date [dd.mm.yy]: %x%x.%x%x.%x%x",
(date&0xf00000)>>20, (date&0xf0000)>>16, // day
(date&0xf000)>>12, (date&0xf00)>>8, //month
(date&0xf0)>>4, (date&0xf) ); // year
time = kol_system_time_get();
printf("\n\r time [hh:mm:ss]: %x%x:%x%x:%x%x\n\r",
(time&0xf0)>>4, (time&0xf), // hours
(time&0xf000)>>12, (time&0xf00)>>8, // minutes
(time&0xf00000)>>20, (time&0xf0000)>>16 ); // seconds
}