C++ 如何将数据时间设置为方法中的参数?

C++ 如何将数据时间设置为方法中的参数?,c++,ubuntu,C++,Ubuntu,嗨 我有一个方法需要包含一个数据时间作为参数。我怎么写这个字符串数据_时间(c_时间)?是否正确? 第二点是: string data_time(c_time time) { i would like to save the hour, second, minute, month and year in different string values. how to do this? need some help. i am working in ubuntu.. thx } 为什么不使

我有一个方法需要包含一个数据时间作为参数。我怎么写这个<代码>字符串数据_时间(c_时间)?是否正确?

第二点是:

 string data_time(c_time time)
{
 i would like to save the hour, second, minute, month and year in different string values. how to do this? need some help. i am working in ubuntu.. thx
} 

为什么不使用模块中的“时间”?示例:,

在您的[answers]()中,有一个是签出
Boost.Datetime
。你这样做了吗?它有很好的文档和足够容易使用;我无法回答第一个问题:)。如果data_time(c_time)正确与否,我已为旧问题中的
字符串
部分编辑了答案。请检查此处,因为此问题可能很快被Mods关闭。