DATEADD() expression

Greg_L
Participant II

I would love to see AppSheet create a DATEADD() expression that allows you to easily add (or subtract) time in different types of units (minutes, days, hours, months, etc…)

It would look like this: DATEADD([date], [#], ‘units’)

So… DATEADD(TODAY(), 10, ‘days’) returns a date that is 10 days after today.

See the way it is used over at Airtable: https://support.airtable.com/hc/en-us/articles/203255215-Formula-field-reference#date_and_time_funct...

Status Open
7 11 2,061
11 Comments
Kirk_Masden
Participant V

I have found working with dates and times to be difficult so anything that makes it easier sounds like a good idea to me. The example you gave, that is, adding days, is currently the easiest one. Adding hours and minutes is harder, though, of course, it can be done:

Steve
Participant V

Add 10 minutes: TIMENOW() + "000:10:00". Good for any number of minutes less than 60.

Add 10 seconds: TIMENOW() + "000:00:10". Good for any number of seconds less than 60.

Not great, but it’s something…

AndreSpeek
Explorer

If it is something and it works, than it is great to me…

Mike_T
Participant V

How do you add 14.5 hours to DateTime?

Mike_T
Participant V

OK…i figured out how to add it. [DateTime]+“014:30:00”.

So now how do I evaluate just the time portion of the [DateTime].

What I want: IF(time of [DateTime] = 6pm, [DateTime]+“014:30:00”, [DateTime]+“07:30:00”)

Thoughts?

Bahbus
Participant V

TIME([DateTime)

Marc_Dillon
Participant V
LeventK
Participant V

@Mike_T

IF(
	TIME([DateTime]) = "18:00:00",
	[DateTime] + "014:30:00",
	[DateTime] + "007:30:00"
)
Mike_T
Participant V

Why do you have to make it look so simple!

Thank you! I promise to only post really hard requests from now on!

LeventK
Participant V

Because it’s simple

Challenge accepted @Mike_T

Status changed to: Open
Pratyusha
Community Manager
Community Manager