【发布时间】:2011-07-11 05:36:52
【问题描述】:
您好,我想知道是否可以编辑时间函数。让我的程序给用户一个重试时间?
struct tm * abc()
{
char *time_string;
time_t curtime;
struct tm *loctime;
/* Get the current time. */
curtime = time (NULL);
/* Convert it to local time representation. */
loctime = localtime (&curtime);
return loctime;
}
这将返回当前时间,但我想做的是编辑它以添加一个值。我这样做的原因是,我可以告诉用户在某个时间使用电流再试一次,并增加 2 分钟。不确定这是否是正确的方法? 谢谢
【问题讨论】: