Skip to content

Instantly share code, notes, and snippets.

@oscarmorrison
Last active December 3, 2023 21:44
Show Gist options
  • Save oscarmorrison/bf14dab89854238d4cca to your computer and use it in GitHub Desktop.
Save oscarmorrison/bf14dab89854238d4cca to your computer and use it in GitHub Desktop.
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

To Use

Simple just place either or both separated by ||| in the
Formatted Row Input on IFTTT Example

@moomdate
Copy link

moomdate commented Nov 9, 2022

\m/

function myFunction(e) {
  Logger.log(JSON.stringify(e));
  if(e && e.changeType === 'INSERT_ROW') {
    var ss = SpreadsheetApp.getActiveSpreadsheet()
    var sheet = ss.getSheetByName("Sheet1");
    sheet.getRange(sheet.getLastRow(),1).setValue(new Date());
  }
}

@OliverK-dev
Copy link

OliverK-dev commented Dec 8, 2022

In Google Sheets you can just use this formula:

=TIMEVALUE(SUBSTITUTE(A1," at ", " ")) + DATEVALUE(SUBSTITUTE(A1," at ", " "))

I simply replaced {{OccurredAt}} with the cell reference -- i.e., A1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment