Date from timestamp


#1

Hi,
I need to convert the timestamp to a date, unfortunately the action Create a date from timestamp doesn’t work.
I pass it the timestamp number of the property ExpireDate from the API.

Thanks for your help in advance.

Hier an example of the API call response:
[
{
“ReferralCode”: 1111,
“img”: “…”,
“Telephone”: “+…”,
“title”: “Jerman Chardonnay 2018 0,75 L”,
"ExpireDate": 1561500000000,
“created”: 1560885210000,
“Publisher”: “La Cantina Italiana”,
“ownerId”: null,
“VolumeType”: “L”,
“Price”: “11,- €”,


#2

@m.canevarollo if you change that value to a String and try it, does that solve the issue. Should be able to use that and drop it in that action so I wonder if it’s an issue of Type here.


#3

Hai @m.canevarollo

Have you found the answer? i want to convert from backendless created date like
“created”: 1560767799838," to date format. can you give an example? @markpiller and @wade.
Thanks


#4

Hi! It doesn’t work dynamically! I think that the problem is that Dropsource can’t display integer value from json in a text view. It works only when I’ve inserted the timestamp value manually and then convert it in a date string.

I used two action to convert a timestamp in a date like dd/MM/yyyy.
Please follow these steps:

  1. Insert in a text view the timestamp value (like: 1562232865)
  2. Select the current page and go to the events section and activate the on load event
  3. Insert at first the action Create a date from timestamp, you have to select the element with the timestamp value from the list.
  4. Then insert the action Format Date to string and select for the first field the returned value of the first action, you can rich that from action data - create a date from timestamp - date
  5. At last insert the action set a value, where you will insert the returned value of format date to string in the textview at point 1.

Now please test it, you will see that when the page is loaded the timestamp is gone and the date appeared.

I repeat, it works only statically. @wade has to research why it doesn’t work dynamically :slight_smile:


#5

Great job finding a workaround for now. I have passed this to engineering for more investigation and will follow up as I receive more info.


#6

Thanks @m.canevarollo for quick respond