Transformer doesn't work on change date to unix timestamp

I have list of items, each item has start/stop date which is saved on Firestone as unix timestamp.
But displaying it as date on retool. So on update transformer can not convert changed date to unix timestamp. Can retool team help me with that?

var updatedData = {{ adsList.recordUpdates }};

updatedData.map(item => {
  
// if date is string
  if (typeof item.start_ts === 'string') {
    item.start_ts = new Date(item.start_ts).getTime() / 1000;
  }
  
  if (typeof item.stop_ts === 'string') {
    item.stop_ts = new Date(item.stop_ts).getTime() / 1000;
  }
});

// has updated data
// but returning it not saving it to Firestone as unix timestamp
// still saving as date
return updatedData;

p.s.
Somewhere I saw, that I had to use data variable, but in transformer has data with diff values in it.

Hi @Nurbek ! So there are a couple of ways you can go about this, but I generally would recommend not to convert between timestamp to string formats, but instead to keep your underlying data as a unix timestamp and then use transformers/mappers to change how that timestamp is displayed using the built-in Moment library.

So for example, if you're displaying the timestamp in a table, you can use a "Mapped Value" on that column to display it as a string with {{moment.unix(self).format("dddd, MMMM Do YYYY, h:mm:ss a")} (the format function can be updated to display in whatever format you like)

Does this make sense?