Jump to content

This topic is 4914 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Happy holidays, everybody:

I "get" that when dealing with timestamps you need to add time in seconds to denote a future time or date, e.g., to add a day to a timestamp the calc would be:

Timestamp + 86400

...since 60 (seconds) x 60 (minutes) x 24 (hours) = 1 day

But, how do you add a month since they can be from 28 days to 31 days? In my typical unwieldy fashion, would I create a Custom Function requiring multiple IF/CASE statements where "If it's January add 31 days; February, 28 days (except for leap years)..." etc.? I'm sure there's a _much_ simpler way of coding the calculation, I'm just not seeing it.

TIA for your help!

Posted (edited)

Try =


Timestamp ( Date ( Month ( timestamp ) + 1 ; Day ( timestamp ) ; Year ( timestamp ) ) ; timestamp )

Edited by comment
Posted

Brilliant, as usual. Thanks...and congrats on reaching 20,000 posts!

This topic is 4914 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.