Forum Discussion

SuryaExpert's avatar
SuryaExpert
Qrew Assistant Captain
6 years ago

Date on a grid edit report while in edit mode shows 1547942400000 for 1/20/2019

In a grid edit report, I have a date field coming from a lookup table (where the date field is the primary key). It shows 1-20-2019 correctly when I click on the drop down arrow. Once I select it, and tab to the next column in the grid, it shows the number 154794240000. When I save the report and it shows the data again, there it shows the date correctly as 1-20-2019.

What am I missing? How can I make sure it shows the date correctly all the time and not as the long numeric field.

4 Replies

  • Dates are internally represented as the number of  milliseconds since that start of the Unix Epoch - midnight on January 1, 1970. This behavior is probably related to making the [Date] field the primary key. Choose another primary key and the behavior you observe will probably go away.
    • SuryaExpert's avatar
      SuryaExpert
      Qrew Assistant Captain
      Dan, It is true that it is the seconds from 1/1/1970. However, it is not related to making the date the primary key. I used to have this issue even when it is an ordinary field in RoR application. When you pull a date value using the QB API, it always gives this result for date fields. Then I used to convert it back to a date to show it on the screen for the user. But in plain quickbase, I wish QuickBase takes care of this. As they pointed out, it is a bug and I urge QB to fix that bug soon.
  • In January 2017 I reported this behavior as well:

    Bug Behavior with Related Reference fields from a source table with a Date-field as the Key
    When you have a table with a Key Field as a Date field; and build a relationship to a child table.

    When you first create the child; your selections are normal (per your record picker). However; when you save the record without making a selection and then edit the record; the drop-down shows a nonsensical unknown value.

    QuickBase response:
    "Sorry to report, but you've run into a bug. 
    QBE010296: Date Time as Reference results in incorrect values in child table "

    I am pretty sure your issue is the same thing.
  • SuryaExpert's avatar
    SuryaExpert
    Qrew Assistant Captain
    As Dan mentioned it is probably the seconds from 1/1/1970. And by the way, it appears right after selecting the value from the dropdown. Once you save it and view it, the date appears correctly. I think the bug is where it shows the seconds from 1/1/1970. It should show the date all the time. That is the desired outcome. Otherwise, the users will complain and I will have to put QuickBase under the bus, (which I hate to do)