There are two types of timestamps we use when writing data in the Collaboration system:
- Current timestamps - these are timestamps that represent the "current time". These timestamps are used for properties such as
- Past timestamps - these timestamps represent dates and times in the past.
By default, current timestamps are set to
CURRENT_TIMESTAMP, which is a constant value that sets that column equal to the current time in most SQL databases.
This is configurable by passing a
getNow function to the Collab Server constructor.
getNow function accepts no parameters and must return a representation of 'now' for your database. By default, we use the value
Whatever value is returned from this function will be passed into your resolvers for any current timestamps.
The following entity properties are always set to the current time:
All timestamps with a known value (in the past) will be passed as a unix timestamp in MS.
In these scenarios, you will need to transform this timestamp into your databases format.
Right now, there is only one scenario where this use case happens:
- Creating an AnnotationMember
AnnotationMember.annotationCreatedAtis passed as a unix timestamp in MS