get_gmt函数在windows下的实现.pptVIP

  • 29
  • 0
  • 约3.09千字
  • 约 12页
  • 2017-02-01 发布于海南
  • 举报
get_gmt函数在windows下的实现

get_gmt函数在windows下的实现 TimeOfDay TimeImpl:: get_gmt() throw(CORBA::SystemException) { time_t time_now=time(0);=time_t time_now=time(NULL); struct tm* time_p=localtime(time_now);//取本机的时间 struct tm* time_p=gmtime(sys);//取格林威治时间 TimeOfDay tod; tod.hour=time_p-tm_hour; tod.minute=time_p-tm_min; tod.second=time_p-tm_sec; return tod;} get_gmt函数在windows下的实现 TimeOfDay TimeImpl:: get_gmt() throw(CORBA::SystemException) { time_t time_now=time(0);//取当前日期和时间的值time_t是整数类型,例如:1095876767 char *p=ctime(time_now);//把此值转换为字符串,例如:Thu sep 23 02:12:47 2004 TimeOfDay tod; tod.hour=((int)p[11]-48)*1

文档评论(0)

1亿VIP精品文档

相关文档