quantlab.utils.date_range.label_ns#
- quantlab.utils.date_range.label_ns(label)[source]#
Return a bar label (or any timestamp) as a nanosecond
datetime64.- Parameters:
- label
A bar label as
metrics.jsonwrites it (an ISO date or timestamp), or anythingpd.Timestampaccepts.
- Returns:
- numpy.datetime64
The exact instant, at nanosecond resolution; a date is midnight.
Examples
>>> label_ns("2024-01-02") np.datetime64('2024-01-02T00:00:00.000000000')