Hello,
I've created a form using Survey123 Connect that features a date entry (as type) with a default of today()...for example it would populate the form with Thursday, February 27, 2020. Today's date.
As an fyi...I added a new row just below this one (text as type) to reformat this date...for example the new date format is illustrated as 02/27/2020. In using Google Sheets in tandem with Integromat it is necessary that the date be represented as such or you get a very strange entry. Anyway...
Further down in my sheet I have another date entry. I would like to take today's date and automatically populate this entry with a date 1 year out from today.
The auto-populate entry for that date would then read 02/27/2021.
Can this be done?
Thanks.
Jeff
Solved! Go to Solution.
Hi Jeff,
Because a year can be 365 or 366 days (as it is this year), the most reliable way to set a date of one year out is to use the date() function to read in the date as a string. Assuming a date question of this_date, the formula would be:
concat(int(format-date(${this_date},'%Y'))+1,format-date(${this_date},'-%m-%dT12:00:00-08:00'))
Note the use of the UTC offset at the end of the time string.
Hi Jeff,
Because a year can be 365 or 366 days (as it is this year), the most reliable way to set a date of one year out is to use the date() function to read in the date as a string. Assuming a date question of this_date, the formula would be:
concat(int(format-date(${this_date},'%Y'))+1,format-date(${this_date},'-%m-%dT12:00:00-08:00'))
Note the use of the UTC offset at the end of the time string.
Thank you, James.
That's exactly what I needed.
Much appreciated!
Jeff
James, I have a Connect form where the date of sale is set by choosing from the calendar. Then there is another dat entry that needs to calculate the expiration of sale automatically 7 days after the date of sale. I'm trying format date and date time field with the date now() function rather unsuccessfully. Can you please help.