Date and time algebra: Difference between revisions

From Cuis CookBook
Jump to navigation Jump to search
(imported material)
(No difference)

Revision as of 20:25, 4 May 2025

Problem. You want to know what will be the weekday name of the day 1000 day in the future from now.

Solution. Cuis has a class Duration and is capable of doing dates algebra.

((DateAndTime now) + (Duration days: 1000)) dayOfWeekName .       "=> #Saturday "

Exercise. Explore the classes DateAndTime, Duration and what is nearby in the Browser.

Exercise. Find the distance in hours between your birth date and your mother's.