/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: src/drivers/wintel32/core/time/win32systemclock.cpp

*/

#include "drivers/wintel32/device.hpp"
#include "sgx/core/core.hpp"

void
CSystemClock::getDate(UTCDate &date)
{
	SYSTEMTIME systime;
	GetLocalTime(&systime);

	date.time.hours = systime.wHour;
	date.time.minutes = systime.wMinute;
	date.time.seconds = systime.wSecond;
	date.time.milliseconds = systime.wMilliseconds;
	
	date.day.dow = SGX_STATIC_CAST(UTCDayOfWeek, systime.wDayOfWeek);

	date.day.day = systime.wDay;
	date.day.month = SGX_STATIC_CAST(UTCMonth, systime.wMonth-1);
	date.day.year = systime.wYear;
}
