本文整理汇总了C++中LocalDateTime::Year方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalDateTime::Year方法的具体用法?C++ LocalDateTime::Year怎么用?C++ LocalDateTime::Year使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalDateTime
的用法示例。
在下文中一共展示了LocalDateTime::Year方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initlize
//----------------------------------------------------------------------------
bool ServerLoop::Initlize()
{
InitializeNetwork();
time_t ti; time(&ti); srand((unsigned int)ti);
#ifdef PX2_USE_MEMORY
Memory::Initialize();
#endif
StringHelp::Initlize();
FString::Initlize();
Logger *logger = new0 Logger();
#if defined(_WIN32) || defined(WIN32)
logger->AddFileHandler("log_server.txt", LT_INFO | LT_ERROR | LT_USER);
#endif
logger->AddOutputWindowHandler(LT_INFO | LT_ERROR | LT_USER);
logger->AddConsoleHandler(LT_INFO | LT_ERROR | LT_USER);
logger->SetLogFileInfo(false);
logger->StartLogger();
LocalDateTime time;
int year1 = time.Year();
int month1 = time.Month();
int week1 = time.Week();
int dayOfMonth1 = time.Day();
int dayOfWeek1 = time.DayOfWeek();
int dayOfYear1 = time.DayOfYear();
int hour1 = time.Hour();
int minute1 = time.Minute();
int second1 = time.Second();
int millisecond1 = time.Millisecond();
int microsecond1 = time.Microsecond();
PX2_LOG_INFO("Y:%d; M:%d; W:%d; DayfMonth:%d; DayOfWeek:%d; H:%d; M:%d; S:%d; Milli:%d; MicroS:%d",
year1, month1, week1, dayOfMonth1, dayOfWeek1, hour1, minute1, second1, millisecond1, microsecond1);
return true;
}
示例2: Initlize
//----------------------------------------------------------------------------
bool EngineLoop::Initlize()
{
time_t ti; time(&ti); srand((unsigned int)ti);
#ifdef PX2_USE_MEMORY
Memory::Initialize();
#endif
StringHelp::Initlize();
FString::Initlize();
Logger *logger = new0 Logger();
#if defined(_WIN32) || defined(WIN32)
logger->AddFileHandler("PX2Application_Log.txt", LT_INFO | LT_ERROR | LT_USER);
#endif
logger->AddOutputWindowHandler(LT_INFO | LT_ERROR | LT_USER);
logger->StartLogger();
LocalDateTime time;
int year1 = time.Year();
int month1 = time.Month();
int week1 = time.Week();
int day1 = time.Day();
int dayOfWeek1 = time.DayOfWeek();
int dayOfYear1 = time.DayOfYear();
int hour1 = time.Hour();
int minute1 = time.Minute();
int second1 = time.Second();
int millisecond1 = time.Millisecond();
int microsecond1 = time.Microsecond();
PX2_LOG_INFO("Year:%d; Month:%d; Week:%d; Day:%d; DayOfWeek:%d; DayOfYear:%d; Hour:%d; Minute:%d; Second:%d; Millisecond:%d; Microsecond:%d",
year1, month1, week1, day1, dayOfWeek1, dayOfYear1, hour1, minute1, second1, millisecond1, microsecond1);
mTimerMan = new0 TimerManager();
mIMEDisp = new0 IMEDispatcher();
mInputMan = new0 InputManager();
mLanguageMan = new0 LanguageManager();
mResMan = new0 ResourceManager();
//PX2_LM.Add("Data/engine/engineLanguage.csv");
mEventWorld = new0 EventWorld();
mScriptMan = new0 LuaManager();
mRoot = new0 GraphicsRoot();
mRoot->Initlize();
mFontMan = new0 FontManager();
PX2_UNUSED(mFontMan);
mADMan = new0 AddDeleteManager();
PX2_UNUSED(mADMan);
mSelection = new0 Selection();
PX2_UNUSED(mSelection);
mCreater = new0 Creater();
PX2_UNUSED(mCreater);
mURDoMan = new0 URDoManager();
PX2_UNUSED(mURDoMan);
mAccoutManager = new0 AccoutManager();
LuaManager *luaMan = (LuaManager*)mScriptMan;
tolua_PX2_open(luaMan->GetLuaState());
mScriptMan->SetUserTypePointer("PX2_ENGINELOOP", "EngineLoop", this);
mScriptMan->SetUserTypePointer("PX2_LOG", "Logger", Logger::GetSingletonPtr());
mScriptMan->SetUserTypePointer("PX2_LM", "LanguageManager", &(PX2_LM));
mScriptMan->SetUserTypePointer("PX2_RM", "ResourceManager", ResourceManager::GetSingletonPtr());
mScriptMan->SetUserTypePointer("PX2_SM", "ScriptManager", ScriptManager::GetSingletonPtr());
mScriptMan->SetUserTypePointer("PX2_SELECTION", "Selection", Selection::GetSingletonPtr());
mScriptMan->SetUserTypePointer("PX2_CREATER", "Creater", Creater::GetSingletonPtr());
mScriptMan->SetUserTypePointer("PX2_URM", "URDoManager", URDoManager::GetSingletonPtr());
LoadBoost("Data/boost.xml");
return true;
}