当前位置: 首页>>代码示例>>C++>>正文


C++ DateTime::makeLocal方法代码示例

本文整理汇总了C++中poco::DateTime::makeLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ DateTime::makeLocal方法的具体用法?C++ DateTime::makeLocal怎么用?C++ DateTime::makeLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在poco::DateTime的用法示例。


在下文中一共展示了DateTime::makeLocal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: run

	void run()
	{
		for(int i=0; i<kNumEnqueueByChild; ++i)
		{
			int counter = ++m_counter;
			Poco::DateTime datetime;
			datetime += Poco::Timespan(m_rnd.next(kScheduleMaxTime)*1000);
			m_queue.enqueueNotification(new ChildNotification(counter, m_name, datetime), datetime.timestamp());
			datetime.makeLocal(Poco::Timezone::tzd());
			m_msg.Message(Poco::format("   enqueueNotification #%d from %s (%s)"
										, counter
										, m_name
										, Poco::DateTimeFormatter::format(datetime.timestamp(), "%H:%M:%S.%i")));
		}
	}
开发者ID:schidler,项目名称:MeCloud,代码行数:15,代码来源:TimedNotificationQueueTest.cpp

示例2: main

//----------------------------------------
//	main
//----------------------------------------
int main(int /*argc*/, char** /*argv*/)
{
	PrepareConsoleLogger logger(Poco::Logger::ROOT, Poco::Message::PRIO_INFORMATION);

	ScopedLogMessage msg("DateTimeTest ", "start", "end");

	Poco::DateTime dateTime;

	msg.Message("  Current DateTime (UTC)");
	DisplayDateTime(dateTime, msg);

	msg.Message(Poco::format("  Current DateTime (Locat Time: %s [GMT%+d])", Poco::Timezone::name(), Poco::Timezone::tzd()/(60*60)));
	dateTime.makeLocal(Poco::Timezone::tzd());
	DisplayDateTime(dateTime, msg);

	msg.Message(Poco::format(Poco::DateTimeFormatter::format(dateTime, "  DateTimeFormatter: %w %b %e %H:%M:%S %%s %Y")
				,	Poco::Timezone::name()));

	return 0;
}
开发者ID:schidler,项目名称:MeCloud,代码行数:23,代码来源:DateTimeTest.cpp

示例3: nowLocal

//--------------------------------------------------------------
Poco::DateTime nowLocal()
{
	Poco::DateTime nowLocal;
	nowLocal.makeLocal(Poco::Timezone::tzd());
	return nowLocal;
}
开发者ID:rmnzr,项目名称:murmur,代码行数:7,代码来源:utils.cpp


注:本文中的poco::DateTime::makeLocal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。