/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     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: sgx/src/sgx/core/time/systemclock.cpp

*/

#include "sgx/core/types/types.hpp"
#include "sgx/core/time/time.hpp"

//
// Dates, with months, years
// 
// NOTE: Every function is here relies on the uber-date
// function, getDate, which must be present in the
// platform-specific code.
// No cross-platform null driver exists for this

UTCDate
CSystemClock::getDate()
{
	UTCDate date;

	getDate(date);
	return date;
}

tUINT32
CSystemClock::getDay()
{
	UTCDate date;

	getDate(date);
	return date.day.day;
}

UTCMonth
CSystemClock::getMonth()
{
	UTCDate date;

	getDate(date);
	return date.day.month;
}

tUINT32
CSystemClock::getYear()
{
	UTCDate date;

	getDate(date);
	return date.day.year;
}

UTCDayOfWeek
CSystemClock::getDayOfWeek()
{
	UTCDate date;

	getDate(date);
	return date.day.dow;
}

//
// Basic time handler
//
void					
CSystemClock::getTime(UTCTime &tm)
{
	UTCDate date;

	getDate(date);
	tm = date.time;
}

UTCTime	
CSystemClock::getTime()
{
	UTCDate date;

	getDate(date);
	return date.time;
}

