开发者

Adding 3 years to a timestamp

I have a timestamp that is fetched from the database. Now I have to add 3 years to it.

  1. Is it possible to add 3 years in timestamp itself and then converting the date and time format ?
  2. or afte开发者_开发问答r converting into the date and time format we can add?

How to add 3 years with respect to leap year and all those?


For every non-leap year, add 365 * 86400 = 31536000.

For every leap year, add 366 * 86400 = 31622400.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜