Closed sent-hil closed 3 years ago
I've checked the code that inserts a meeting to the db, in particular https://github.com/codeforsanjose/gov-agenda-notifier/blob/71685429c028585727398025fcdf1dc594111507/backend/graphql_api/lambda/db/dbClient.js#L48-L58
Here we use Date.now()
which returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC. But PG function to_timestamp
expects seconds, it seems. Quote from the docs:
A single-argument to_timestamp function is also available; it accepts a double precision argument and converts from Unix epoch (seconds since 1970-01-01 00:00:00+00) to timestamp with time zone. (Integer Unix epochs are implicitly cast to double precision.)
@anna-kartynnik so that must be the problem! I will fix it when I get a chance or since you already did most of the work feel free to change it as part of your PR.
I think it's a problem converting from JS time to Postgres time type.
Call this from ui
And Then:
created_timestamp and updated_timestamp should return time from few seconds ago, but will return wrong dasta.