datetime

Methods

Method Reference: datetime.yyyymmdd

datetime: D = yyyymmdd (T)

Convert datetime array to YYYYMMDD numeric form.

D = yyyymmdd (T) returns a double array D of the same size as T in which each element encodes the date of the corresponding datetime as year * 10000 + month * 100 + day. The time of day is ignored. Not-A-Time (NaT) values are returned as NaN.

Source Code: datetime

yyyymmdd packs the date into one number as year*10000 + month*100 + day; the time of day is ignored.

 t = datetime (2024, 3, 9, 6, 0, 0)
t =
  datetime

   09-Mar-2024 06:00:00
 yyyymmdd (t)
ans = 2.0240e+07