Format date as Epoch/UNIX?

Hello,

I have a list of dates in Epoch format that i am getting from an api call(as a list). My goal is to only call the dates that are from the current day i.e. date from api >= currentdate/time:rounded to day.

I can filter this query through the api but here is the issue: I am comparing a list of dates that are in Epoch/Unix format to Tue, 10/03/23, October (Oct) 3rd, 2023, 12:00 am, 00:00:00.00.

I decided to format the right hand side of the equation to Epoch/Unix, but that option is not available. I selected the Custom option but I don’t know what format to write out for Epoch/Unix. Any ideas?

Note: I would like to filter the query instead of filter after the call has been made, hence the conversion from current date to UNIX.

Current date: Extract: Unix

You may need to divide the result by 1000 or 100 depending on how many digits the API expects. Bubble extracts the maximum digits, which I believe is in milliseconds.

2 Likes

Thank you! I had tried this for the current date, but when i tried current data:round to day:extract:, the unix option didnt appear, which may have just been a visual bug. Thank you again!

It should be there. I’m doing that exact operation in my app: Current date: rounded down to day: extract: unix

You may need to refresh your page or clear your cache if you’re not seeing it.

Yes it now works. Thank you!

This topic was automatically closed after 70 days. New replies are no longer allowed.