lindelwa122 / data-watch-orm

A Python ORM
MIT License
11 stars 6 forks source link

helpers/earliest #6

Open lindelwa122 opened 1 month ago

lindelwa122 commented 1 month ago

Each instance in the dataset (or model) will have a _created_on attribute, which is of the datetime data type. This function should identify the instance that was created first. You can use the following code snippet to extract the necessary information:

for item in data:
    dt = item._created_on
    year, month, day = dt.year, dt.month, dt.day
    hour, minute, second = dt.hour, dt.minute, dt.second