Using date and times with Xano

Anyone using Xano for external collections. I’m having an issue getting the date/time coming from Xano to be in the right format for Adalo components. I change the Unix to Y-m-d H:i:s but Adalo reads them as text rather than date.

1 Like

Hi,
I haven’t used xano yet, setting it up to move away from Airtable. But have you tried to check the format in the external collection? You can change the field format:

image

Btw can you share how you filter data from Xano? in the lists? Thank you very much.

Here is a screenshot of my xano API call to GET a list of appointments.

My trouble is now POSTing a new appointment with 2 timestamps in a format Xano can read correctly.

Also, here is a link to a video showing how to GET timestamps formatted correctly.

3 Likes

Interestingly, Adalo somehow recognizes the created_at field that comes as a default with any of my Xano external collections. I looked at the settings to see if this timestamp was set up differently, but looks just like the others. Adalo doesn’t even have it as a timestamp field type, and the Magic Text input also relabeled the field “create_at” to “Date Created” … odd.

TLDR: Adalo probably has some “date created conversion” function to read created_at timestamps from Xano external collections. My suggestion is to ignore this rabbit hole and stick to doing the time format function described here for all timestamps in Xano APIs

Xano uses the Epoch Unix Timestamp, the reason that Adalo recognizes, is that most databases use that timestamp as metadata (created, modified dates), so it is common, you can check here conversions.

Keep in mind that when you send a date to Xano from Adalo, you do need to a conversion in the unix timestamp to miliseconds, as some use format in seconds, others in miliseconds.

1 Like

@JL_LJ My post did a poor job of describing the issue:

  • I have created a modified_at timestamp field for each table in my Xano instance.
  • It looks to have the same settings as the created_at field that is pre-built with every table
  • When I’m doing an external database, everything tells me these two fields are sent exactly the same way to adalo.

BUT… Only my created_at is being recognized as a timestamp. The updated_at timestamp (along with any others) is being treated as a standard number entries. Can’t change the field type in the database dropdown menu in Adalo’s side, can’t change the way the number is displayed on the screen editor.

This is constant and repeatable across more than one table, which led me to believe that Adalo does not actually recognize Epoch Unit Timestamp, but has instead created a function that searches for that created_at field and transforms it (and only that one) internally before allowing the Adalo user to manipulate that field.

Can anyone replicate this issue or is this a problem with my setup?

1 Like