Convert json value to datetime

this is my current flow:
-query an API, getting back a big response
-query that JSON response using "query JSON with SQL" to get a result that looks like this:

I need to change those date_sent fields to be datetimes. Any tips for how i can do this, either in the original API query, the JSON sql query, or in a transformer somewhere?

Hi @claire

It depends on what you want to do with those dates, so you can decide the right format.

You can do it in the transformer after the query with something like:

data.forEach(d => {
   // date time iso
   d.isodatetime = new Date(d.date_sent).toISOString()

   // or if you want the timestamp
   d.timestamp = new Date(d.date_sent).getTime()
})

Hope this help

Hi @claire
Not sure what you want to do with dates, but you change these dates into date format using the moment library.

For more formats, please check their documentation Moment.js | Docs