quantlab.utils.date_range.bar_label#
- quantlab.utils.date_range.bar_label(value)[source]#
Return the label
metrics.jsonand the report write for a bar.A bar at midnight is written as an ISO date, any other bar as a full ISO timestamp, so daily labels stay dates while intraday labels keep their time of day;
label_nsreads either back.- Parameters:
- value
A bar: a
numpy.datetime64, apd.Timestampor a stringpd.Timestampaccepts.
- Returns:
- str
The label.
Examples
>>> bar_label(np.datetime64("2024-01-02T00:00")) '2024-01-02' >>> bar_label(pd.Timestamp("2024-01-02 15:30")) '2024-01-02T15:30:00'