$toTimestamp
The$toTimestamp operator converts a date object to a timestamp.
Input
- An array containing a date object and an optional granularity parameter (0 for seconds, 3 for milliseconds, 6 for microseconds, 9 for nanoseconds)
Output
- The timestamp representation of the date object
Examples
Convert Date to Unix Timestamp (Seconds)
1673777400 (seconds since Unix epoch)
Convert Date to Milliseconds
1673777400000 (milliseconds since Unix epoch)

