Magyar oldal English site

Site map
2024-10-16 10:02:29 (Originally published at: 2024-10-16)

Let's use common era days as a calendar

There has been proposals about why don't we simply use Julian date or some other linear day count. That would make date calculations as simple as subtracting and adding days.

However nothing prevents us to still arrange these dates into weeks, months and years. In fact we can quite easily do so: just divide it with the period.

I propose to use the common era day count as linear day count, because it can be converted to day of week and years nicely.

For example today is the 739175th day since 0001-01-01 in Proleptic Gregorian calendar. Divide this with length of the tropical year 365.2422 to get:

    739175/365.2422 = 2023.794074179

So 2023 years and 79% of the Year 2024 elapsed.

Divide it with 7 to get:

    739175/7 = 105596.428571429

Which indicates that 105596 week has elapsed and and 43% of the current week is done, which indicates it's Wednesday. Monday is 14%, Tuesday is 29%, Wednesday is 43%, Thursday is 57%, Friday is 71%, Saturday is 86%, Sunday is 0%.

Subtract 10 and divide by 29.53059 to get the lunar phase:

    (739175-10)/29,53059 = 25030.485337408

Which indicates that the current lunar cycle is at 48%, which is basically about full moon.

But sometimes you still want the integer days within a cycle rather that floating point remainders. This can be achieved by defining a splitting function like this:

    split(n, p):
        cycle = ceil(n/p)
        units_in_cycle = ceil(-((cycle-1)*p - n)) (= n - floor((cycle-1)*p))
        return (cycle, units_in_cycle)

The floor function rounds fractions down to the previous integer. The ceil function rounds fractions up to the next integer. This allow performing the calculation using a calculator. For example to calculate the year and day of year for Day 739175:

  1. Enter 739175: 739175
  2. Divide 365.2422: 2023.794074179
  3. Round up and write down, it's Year 2024.
  4. Enter 2023: 2023
  5. Multiply 365.2422: 738884.9706
  6. Subtract 739175: -290,0294
  7. Change sign and round up: it's Day 291.

The inverse of this calculation can be done using the merging function:

    merge(cycle, unit_of_cycle, p) = floor((cycle-1)*p + unit_of_cycle)

So using Year 2024 and Day 291 enter 2023*365.2422 + 291 to get 739175.9706 and round it down to get 739175. This way we can calculate which day an anniversary is on for example.

I haven't said a word about leap years yet. That's because this scheme automatically finds that out. If you calculate the year and day for Day 739250 you'll find that's day 366 in year 2024.

But keep in mind this calculation does not intend to match Gregorian calendar. In fact it arranges leap years more regularly than the Gregorian by having an 5 year gap sometimes instead of a 8 year gap around 100 divisible years. The previous 5 year gap was right before 2024 when this scheme makes 2019 into a leap year and the next 5 year gap will be between 2048 and 2053.

If you still want to use a calendar in a classical sense you can still arrange these days into weeks and lunar or regular months too. It's up to you what scheme do you use to lay the year out.

In order to do that, first calculate the date range to generate the calendar:

    head = merge(year, 1, 365.2422)
    tail = merge(year+1, 1, 365.2422)

Then for each day i in the interval [head, tail). We calculate:

    (week_number, day_of_week) = split(i, 7)
    (lunation_number, _) = split(i - 10, 29.53059)

Then using the week_number, day_of_week and lunation_number we can arrange the is into a lunar calendar chart like this:

	Today is Day 739175 in common era
	Year 2024
	Start day: 738885, start week: 105555, start lunation: 25021

		           M 25021                                      M 25022                                      M 25023                                            
	       M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
	W555 |                               8885    W557 |           8895 8896 8897 8898 8899    W561 |                     8925 8926 8927                             
	W556 | 8886 8887 8888 8889 8890 8891 8892    W558 | 8900 8901 8902 8903 8904 8905 8906    W562 | 8928 8929 8930 8931 8932 8933 8934                             
	W557 | 8893 8894                             W559 | 8907 8908 8909 8910 8911 8912 8913    W563 | 8935 8936 8937 8938 8939 8940 8941                             
		                                     W560 | 8914 8915 8916 8917 8918 8919 8920    W564 | 8942 8943 8944 8945 8946 8947 8948                             
		                                     W561 | 8921 8922 8923 8924                   W565 | 8949 8950 8951 8952 8953                                       
		                                                                                                                                                        
		           M 25024                                      M 25025                                      M 25026                                            
	       M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
	W565 |                          8954 8955    W570 | 8984 8985 8986 8987 8988 8989 8990    W574 |           9014 9015 9016 9017 9018                             
	W566 | 8956 8957 8958 8959 8960 8961 8962    W571 | 8991 8992 8993 8994 8995 8996 8997    W575 | 9019 9020 9021 9022 9023 9024 9025                             
	W567 | 8963 8964 8965 8966 8967 8968 8969    W572 | 8998 8999 9000 9001 9002 9003 9004    W576 | 9026 9027 9028 9029 9030 9031 9032                             
	W568 | 8970 8971 8972 8973 8974 8975 8976    W573 | 9005 9006 9007 9008 9009 9010 9011    W577 | 9033 9034 9035 9036 9037 9038 9039                             
	W569 | 8977 8978 8979 8980 8981 8982 8983    W574 | 9012 9013                             W578 | 9040 9041 9042                                                 
		                                                                                                                                                        
		           M 25027                                      M 25028                                      M 25029                                            
	       M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
	W578 |                9043 9044 9045 9046    W582 |                          9073 9074    W586 |                               9102                             
	W579 | 9047 9048 9049 9050 9051 9052 9053    W583 | 9075 9076 9077 9078 9079 9080 9081    W587 | 9103 9104 9105 9106 9107 9108 9109                             
	W580 | 9054 9055 9056 9057 9058 9059 9060    W584 | 9082 9083 9084 9085 9086 9087 9088    W588 | 9110 9111 9112 9113 9114 9115 9116                             
	W581 | 9061 9062 9063 9064 9065 9066 9067    W585 | 9089 9090 9091 9092 9093 9094 9095    W589 | 9117 9118 9119 9120 9121 9122 9123                             
	W582 | 9068 9069 9070 9071 9072              W586 | 9096 9097 9098 9099 9100 9101         W590 | 9124 9125 9126 9127 9128 9129 9130                             
		                                                                                  W591 | 9131                                                           
		           M 25030                                      M 25031                                      M 25032                                            
	       M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
	W591 |      9132 9133 9134 9135 9136 9137    W595 |           9161 9162 9163 9164 9165    W599 |                     9191 9192 9193                             
	W592 | 9138 9139 9140 9141 9142 9143 9144    W596 | 9166 9167 9168 9169 9170 9171 9172    W600 | 9194 9195 9196 9197 9198 9199 9200                             
	W593 | 9145 9146 9147 9148 9149 9150 9151    W597 | 9173 9174 9175 9176 9177 9178 9179    W601 | 9201 9202 9203 9204 9205 9206 9207                             
	W594 | 9152 9153 9154 9155 9156 9157 9158    W598 | 9180 9181 9182 9183 9184 9185 9186    W602 | 9208 9209 9210 9211 9212 9213 9214                             
	W595 | 9159 9160                             W599 | 9187 9188 9189 9190                   W603 | 9215 9216 9217 9218 9219                                       
		                                                                                                                                                        
		           M 25033                                      M 25034                                                                                         
	       M    T    W    T    F    S    S              M    T    W    T    F    S    S                                                                             
	W603 |                          9220 9221    W608 | 9250                                                                                                        
	W604 | 9222 9223 9224 9225 9226 9227 9228                                                                                                                       
	W605 | 9229 9230 9231 9232 9233 9234 9235                                                                                                                       
	W606 | 9236 9237 9238 9239 9240 9241 9242                                                                                                                       
	W607 | 9243 9244 9245 9246 9247 9248 9249                                                                                                                       

Only the last 4 digits of days and last 3 digits of weeks are shown to save space, each month starts roughly at new moon and month number is written in full. The first and last lunar month is partial, the rest of them are in the next and previous year's chart.

The day of year can be obtained by subtracting the first day of year from the current day too, as you need that for anniversaries or stuff.

But if you don't care about the moon, you can use a different calculation to arrange the months regularly.

    (_, day_of_year) = split(i, 365.2422)
    (week_number, day_of_week) = split(i, 7)
    (month, _) = split(day_of_year, 30.5)

And then use week_number, day_of_week, month to generate this chart:

    Year 2024

                    M 1                                          M 2                                          M 3                                                
        M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
    W555 |                               8885    W560 |      8915 8916 8917 8918 8919 8920    W564 |                     8946 8947 8948                             
    W556 | 8886 8887 8888 8889 8890 8891 8892    W561 | 8921 8922 8923 8924 8925 8926 8927    W565 | 8949 8950 8951 8952 8953 8954 8955                             
    W557 | 8893 8894 8895 8896 8897 8898 8899    W562 | 8928 8929 8930 8931 8932 8933 8934    W566 | 8956 8957 8958 8959 8960 8961 8962                             
    W558 | 8900 8901 8902 8903 8904 8905 8906    W563 | 8935 8936 8937 8938 8939 8940 8941    W567 | 8963 8964 8965 8966 8967 8968 8969                             
    W559 | 8907 8908 8909 8910 8911 8912 8913    W564 | 8942 8943 8944 8945                   W568 | 8970 8971 8972 8973 8974 8975                                  
    W560 | 8914                                                                                                                                                     
                    M 4                                          M 5                                          M 6                                                
        M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
    W568 |                               8976    W573 |           9007 9008 9009 9010 9011    W577 |                     9037 9038 9039                             
    W569 | 8977 8978 8979 8980 8981 8982 8983    W574 | 9012 9013 9014 9015 9016 9017 9018    W578 | 9040 9041 9042 9043 9044 9045 9046                             
    W570 | 8984 8985 8986 8987 8988 8989 8990    W575 | 9019 9020 9021 9022 9023 9024 9025    W579 | 9047 9048 9049 9050 9051 9052 9053                             
    W571 | 8991 8992 8993 8994 8995 8996 8997    W576 | 9026 9027 9028 9029 9030 9031 9032    W580 | 9054 9055 9056 9057 9058 9059 9060                             
    W572 | 8998 8999 9000 9001 9002 9003 9004    W577 | 9033 9034 9035 9036                   W581 | 9061 9062 9063 9064 9065 9066 9067                             
    W573 | 9005 9006                                                                                                                                                
                    M 7                                          M 8                                          M 9                                                
        M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
    W582 | 9068 9069 9070 9071 9072 9073 9074    W586 |           9098 9099 9100 9101 9102    W590 |                          9129 9130                             
    W583 | 9075 9076 9077 9078 9079 9080 9081    W587 | 9103 9104 9105 9106 9107 9108 9109    W591 | 9131 9132 9133 9134 9135 9136 9137                             
    W584 | 9082 9083 9084 9085 9086 9087 9088    W588 | 9110 9111 9112 9113 9114 9115 9116    W592 | 9138 9139 9140 9141 9142 9143 9144                             
    W585 | 9089 9090 9091 9092 9093 9094 9095    W589 | 9117 9118 9119 9120 9121 9122 9123    W593 | 9145 9146 9147 9148 9149 9150 9151                             
    W586 | 9096 9097                             W590 | 9124 9125 9126 9127 9128              W594 | 9152 9153 9154 9155 9156 9157 9158                             
                                                                                                                                                                    
                    M 10                                         M 11                                         M 12                                               
        M    T    W    T    F    S    S              M    T    W    T    F    S    S              M    T    W    T    F    S    S                                
    W595 | 9159 9160 9161 9162 9163 9164 9165    W599 |                9190 9191 9192 9193    W603 |                          9220 9221                             
    W596 | 9166 9167 9168 9169 9170 9171 9172    W600 | 9194 9195 9196 9197 9198 9199 9200    W604 | 9222 9223 9224 9225 9226 9227 9228                             
    W597 | 9173 9174 9175 9176 9177 9178 9179    W601 | 9201 9202 9203 9204 9205 9206 9207    W605 | 9229 9230 9231 9232 9233 9234 9235                             
    W598 | 9180 9181 9182 9183 9184 9185 9186    W602 | 9208 9209 9210 9211 9212 9213 9214    W606 | 9236 9237 9238 9239 9240 9241 9242                             
    W599 | 9187 9188 9189                        W603 | 9215 9216 9217 9218 9219              W607 | 9243 9244 9245 9246 9247 9248 9249                             
                                                                                              W608 | 9250                                                           

Then month lengths will alternate between 30 and 31 days, where odd months are all 30 days long, even months are all 31 days long, except the 12th month is 31 days only in leap years otherwise 30. That's the most regular months can get, making the quarters 91, 92, 91, 91 days long in common years and having the last quarter be 92 days in leap years.

In both cases the day is identified by the same number. So there is no ambiguity in the date.

If you want to discuss this post, share it on social media.
Recently updated:
Logo