Timestamp in milliseconds

For an API destination I’m using, they require a “sequence” of records submitted. They suggest this sequence could for instance be the timestamp in milliseconds.

When developing your Import API script, you’ll need to define how values for the sequence property are generated. A simple solution is just to use the current timestamp, but before doing so, consider the following:

How frequently are the records being updated?

If records with identical Primary Key values are updated every few milliseconds and pushed simultaneously, the correct version of a record may not be loaded successfully. This means that records with the same Primary Key values can’t be sent during the same clock resolution. For example: If the resolution is measured in milliseconds, records with identical Primary Key values cannot be sent during the same millisecond.

I could only find the timestamp in seconds in Wappler, not milliseconds. Is this available somehow? Or do you maybe suggest another way to enforce a sequence of records? It should be a sequence that is sustained over multiple runs, so a simple counter that resets after each server action run isn’t enough as I understand it.

Community Page
Last updated: