CITE THIS NOTEBOOK: Wolfram R&D LIVE: Understand Time, Date and Calendars by Nick Lariviere. Wolfram Community MAR 14 2023.
Introduction to Time
Introduction to Time
What time is it?
What time is it?
In[]:=
UnixTime[]
Out[]=
1678820588
What is time?
What is time?
Time is the continued sequence of existence and events that occurs in an apparently irreversible succession from the past, through the present, into the future.
◼
The current definition in the International System of Units for a second:
The second is defined by taking the fixed numerical value of the caesium frequency, ΔνCs, the unperturbed ground-state hyperfine transition frequency of the caesium 133 atom, to be 9192631770 when expressed in the unit Hz, which is equal to s−1.
In[]:=
Dynamic[Refresh[UnixTime[],UpdateInterval->1]]
In[]:=
Dynamic[Refresh[SiderealTime[],UpdateInterval->1]]
Introduction to Dates
Introduction to Dates
In[]:=
TimelinePlot[RandomDate[10]]
Out[]=
What is today’s date?
What is today’s date?
In[]:=
Today
Out[]=
In[]:=
DateObject[Today,CalendarType->"ISOWeek"]
Out[]=
In[]:=
DateObject[Today,CalendarType->"Japanese"]
Out[]=
In[]:=
Manipulate[DateString@DateObject[CalendarType->i],{{i,"Gregorian"},CalendarData["DateCalendar"]}]
Out[]=
What are dates?
What are dates?
• A date is a reference to a particular instance of time (typically a day) represented within a calendar system, which allows the specific instance to be uniquely identified.
Introduction to Calendars
Introduction to Calendars
Out[]=
January 2023 |
What are calendars?
What are calendars?
• A calendar is a system for organizing dates and times using periods of time, often consisting of various elements like days, months, and/or years.
What types of calendars are there?
What types of calendars are there?
In[]:=
CalendarData["DateCalendar"]
• Observational calendars
• Regnal calendars
In[]:=
DateObject[CalendarType->"Japanese"]
Out[]=
• Arithmetic calendars
In[]:=
CalendarData["ArithmeticCalendar"]
• Astronomical calendars
In[]:=
CalendarData["AstronomicalCalendar"]
◼
Solar calendars
Solar calendars (including Egyptian, Armenian, Persian, Gregorian, Julian, Coptic, Ethiopic, ISO, French Revolutionary and Bahá’í) are based on the yearly solar cycle. Most solar calendars are divided into months, but these months are divorced from the lunar events.
◼
Lunar calendars
Lunar calendars (such as Islamic and Jewish) take the monthly lunar cycle as their basic building block.
◼
Lunisolar calendars
Lunisolar calendars combine the yearly solar cycle with monthly lunar cycles. Because these two cycles do not align, they typically include periodic leap months and/or days for realignment.
In[]:=
CalendarConvert@DateObject[{72,25,4,20},"Day",CalendarType"Chinese"]
Out[]=
In[]:=
CalendarConvert@DateObject[{72,25,LeapVariant[4],20},"Day",CalendarType"Chinese"]
Out[]=
In[]:=
DateValue,{"Year","Month","Day"}
Out[]=
{2039,LeapVariant[7],LeapVariant[14]}
Calendar Granularity
Calendar Granularity
What are calendar granularities?
What are calendar granularities?
Calendar granularities are the units that compose the timekeeping steps of a given calendar, such as a year, month or day.
What is a Year?
What is a Year?
• The calendar granularity associated to the motion of the Earth around the Sun. There are two main definitions: the tropical year and the sidereal year, with the first one being more important, because it is tied to the seasons, something fundamental for agriculture. Then there are many other concepts of year.
What is a Month?
What is a Month?
• A month is approximately the time that the moon takes to move once around the earth. This is a vague definition. The motion of the moon has several irregularities, so the definition needs to be an average anyway.
• The lunar cycle formed the basis for the palaeolithic marking of time. Some calendars start a month with the new moon (Hebrew or Islamic) or with the full moon (in northern India, for example). For calendars in which the month begins with the observed new moon, beginning the day at sunset is natural.
What is a Day?
What is a Day?
• A day is the time period of a full rotation of the Earth with respect to the Sun (on average, this is 24 hours, 1440 minutes, or 86,400 seconds, but as with other granularities the actual length of a day varies depending on the point of reference).
• The difference between a sidereal day and a solar day is associated with the tropical year:
• The day starts at different times in different calendars: sunset, midnight, sunrise, noon. From CC, definition of day i (JD means Julian Day):
Application to Arithmetic
Application to Arithmetic
What is the date one month after January 30th?
What is the date one month after January 30th?
What are date arithmetic methods?
What are date arithmetic methods?
There are two main methods of doing arithmetic with dates:
◼
Continuous - uses a fixed definition of unit steps (e.g. 1 month is always 2628000 seconds), and thus does not need to account for variation in unit length
◼
Discrete - uses calendar steps of potentially dynamic length (depending on the calendar being used), which needs to account for gaps/intercalation/daylight saving/leap seconds.
For discrete arithmetic, there is also variation in the method by which variable calendar step lengths handle “rolling” when a gap is encountered during arithmetic (most commonly “Month” on the Gregorian calendar). The three main methods for doing this are:
◼
Roll Forward - skip over to the next valid date
◼
Roll Backward - stay on the last valid date
◼
Roll Over - continue to the next valid date and keep adding from there
Time Zones
Time Zones
What are time zones?
What are time zones?
A time zone is an area which observes a uniform standard time. Time zones typically to follow the boundaries between countries and their subdivisions instead of strictly following longitude, because it is convenient for areas in frequent communication to keep the same time.
What kinds of time zones are there?
What kinds of time zones are there?
◼
numeric time zones
These time zones are a fixed offset from Greenwich Mean Time (GMT), and typically given as a number of hours difference in locale time.
◼
internet time zones
The Internet Assignment Number Authority (IANA) maintains a database of geographic time zones in a database that collects the various rules for time zone offsets both historically and currently, and is updated regularly.
Time Systems
Time Systems
What are time systems?
What are time systems?
A time system is a specification for measuring time (the rate at which time passes, how points in time are measured, or both).
What kinds of time systems are there?
What kinds of time systems are there?
observation of the duration of each day from 1990 to 2000
because these were all longer than 24 hours, we need leap seconds.
get the difference between TAI and UT1 from 1990 to 2000
get the difference between TAI and UTC for the same period
Here is an example comparing a leap second being added, as seen through both TAI and UTC:
Introduction to Date Formats
Introduction to Date Formats
What are date formats?
What are date formats?
A date format is a specification of what elements of a date are given, and in what order. Date formats may come from international, national, or local standards.
What kind of date formats are there?
What kind of date formats are there?
Introduction to Locales
Introduction to Locales
What are locales?
What are locales?
A locale is a set of parameters that defines ones language, region and any special variants in localizing dates. Usually a locale identifier consists of at least a language code and a country/region code.
What kind of locales are available?
What kind of locales are available?
Additional Resources
Additional Resources
◼
Calendrical Calculations by Edward M. Reingold, Nachum Dershowitz
◼
ISO-8601 date and time standard
◼
IANA time zone database
