add seconds to a date

后端 未结 4 1892
星月不相逢
星月不相逢 2020-12-17 15:03

I need to add seconds to a date. For example, if I have a date such as 2009127000000, I need to add the seconds to this date. Another example, add 50 seconds to 200912312359

4条回答
  •  情歌与酒
    2020-12-17 15:44

    The C date/time type time_t is implemented as the number of seconds since a certain date, so to add seconds to it you simply use normal arithmetic. If this is not what you are asking about please make your question clearer.

提交回复
热议问题