What's the proper date format when sending data to Bubble via the old API?

I’m sending data to Bubble and can’t get the date field to be saved in our database. Is there a particular format that’s required?

1 Like

Bubble is quite understanding, what we do behind the scene is (in JS)

new Date(value you send)

so you can do

new Date(“Fri Oct 21 2016 15:16:34 GMT-0400 (EDT)”)

new Date(1477077414986)

new Date(“Friday October 21 2016 15:16:34”)

new Date(“10/21/2016 15:16:34”)

Does it support this format: 2016-10-21T16:21:00Z

It’s a question for Javascript. If you try in the console you get this

new Date("2016-10-21T16:21:00Z")

-> Fri Oct 21 2016 12:21:00 GMT-0400 (EDT)

1 Like

Is there a way we can receive a text string date inside of bubble in one of these formats and save it as a date?

I am sending a UNIX time stamp to Bubble but I get this error from Bubble’s api… ?

{“statusCode”:400,“body”:{“status”:“INVALID_DATA”,“message”:“Invalid data for key date: Expected a date, but got a string (original data: “1567090560.0”)”},“args”:{“bubble_code”:“1567004152383x326404708418242600”}}

What do I do to solve this?

First of all, remove the decimal part from timestamp. If it does not work, try sending the value as a number instead of a string.