In MongoDB, the $millisecond aggregation pipeline operator returns the millisecond portion of a date as an integer between 0 and 999.
You can optionally specify a timezone to use for the result.
The $millisecond operator accepts either a date (as either a Date, a Timestamp, or an ObjectId), or a document that specifies the date and timezone to use.