lindelwa122 / data-watch-orm

A Python ORM
MIT License
6 stars 3 forks source link

helpers/earliest #6

Open lindelwa122 opened 4 hours ago

lindelwa122 commented 4 hours 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