开发者

Adding 3 years to a timestamp

开发者 https://www.devze.com 2023-03-31 05:58 出处:网络
I have a timestamp that is fetched from the database. Now I have to add 3 years to it. Is it possible to add 3 years in timestamp itself and then

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

精彩评论

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