Module chrono_ops

Module chrono_ops 

Source

Functionsยง

add_days
Add days to a DateTime
add_hours
Add hours to a DateTime
add_minutes
Add minutes to a DateTime
day_of_week
Get day of week (Monday = 0, Sunday = 6)
days_between
Calculate the number of days between two DateTimes
end_of_day
Get the end of day (23:59:59) for a DateTime
extract_day
Extract day from DateTime (1-31)
extract_hour
Extract hour from DateTime (0-23)
extract_minute
Extract minute from DateTime (0-59)
extract_month
Extract month from DateTime (1-12)
extract_second
Extract second from DateTime (0-59)
extract_year
Extract year from DateTime
hours_between
Calculate the number of hours between two DateTimes
is_after
Check if a DateTime is after another DateTime
is_before
Check if a DateTime is before another DateTime
is_between
Check if a DateTime is between two DateTimes (inclusive)
is_business_hours
Check if a DateTime falls within business hours (9 AM - 5 PM)
is_future
Check if a DateTime is in the future
is_past
Check if a DateTime is in the past
is_same_day
Check if two DateTimes are on the same day
is_today
Check if a DateTime is today
is_weekday
Check if a DateTime is on a weekday (Monday-Friday)
is_weekend
Check if a DateTime is on a weekend (Saturday or Sunday)
is_within_duration
Check if a DateTime is within a duration from now
start_of_day
Get the start of day (midnight) for a DateTime
subtract_days
Subtract days from a DateTime
subtract_hours
Subtract hours from a DateTime
subtract_minutes
Subtract minutes from a DateTime