Spaces:
Sleeping
Sleeping
| from datetime import datetime | |
| from typing import Tuple | |
| class TimeEngine: | |
| def get_season() -> str: | |
| """Get current season based on month""" | |
| month = datetime.now().month | |
| if month in [12, 1, 2]: | |
| return "winter" | |
| elif month in [3, 4, 5]: | |
| return "spring" | |
| elif month in [6, 7, 8]: | |
| return "summer" | |
| else: | |
| return "autumn" | |
| def get_time_of_day() -> str: | |
| """Get time of day for context""" | |
| hour = datetime.now().hour | |
| if hour < 12: | |
| return "morning" | |
| elif hour < 18: | |
| return "afternoon" | |
| else: | |
| return "evening" | |
| def get_current_date() -> str: | |
| """Get current date (YYYY-MM-DD)""" | |
| return datetime.now().strftime("%Y-%m-%d") | |
| def get_current_time() -> str: | |
| """Get current time (HH:MM)""" | |
| return datetime.now().strftime("%H:%M") |