系统日期 [英] system date
问题描述
用c ++获取系统日期是否容易?
像SQL或VB这样的东西?
-
问候,
温
Is it easy to get the system date in c++?
Somethings like in SQL or VB?
--
Regards,
Wen
推荐答案
" Wen" <我们************ @ hccnet.nl>写道...
"Wen" <We************@hccnet.nl> wrote...
用c ++获取系统日期是否容易?
像SQL或VB那样的东西?
Is it easy to get the system date in c++?
Somethings like in SQL or VB?
//获取系统日历时间
std :: time_t tt = std :: time(0);
//将其转换为tm struct
std :: tm ttm = * std :: localtime(& tt);
//提取日,月,年的值
int mday = ttm .tm_mday;
...
Victor
// get the system calendar time
std::time_t tt = std::time(0);
// convert it into tm struct
std::tm ttm = *std::localtime(&tt);
// extract the values for day, month, year
int mday = ttm.tm_mday;
...
Victor
谢谢Victor,
你的代码对我来说很难。
最好的问候,
温
Victor Bazarov <五******** @ comAcast.net> schreef in bericht
news:nsqCb.324347
Thank you Victor,
Your codes are to difficult for me.
Best Regards,
Wen
"Victor Bazarov" <v.********@comAcast.net> schreef in bericht
news:nsqCb.324347
Dw6.1094815@attbi_s02 ...
Dw6.1094815@attbi_s02...
" Wen" <我们************ @ hccnet.nl>写了...
"Wen" <We************@hccnet.nl> wrote...
用c ++获取系统日期是否容易?
像SQL或VB这样的东西?
Is it easy to get the system date in c++?
Somethings like in SQL or VB?
//得到系统日历时间
std :: time_t tt = std :: time(0);
//将其转换为tm struct
std :: tm ttm = * std :: localtime(& tt);
//提取日,月,年的值
int mday = ttm.tm_mday;
...
Victor
// get the system calendar time
std::time_t tt = std::time(0);
// convert it into tm struct
std::tm ttm = *std::localtime(&tt);
// extract the values for day, month, year
int mday = ttm.tm_mday;
...
Victor
这篇关于系统日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!