Clock.time.civil: def of ezsys@0.1.0.0 Import: import ezsys@0.1.0.0/src/clock.bend as Clock Lines 70-80 of ezsys@0.1.0.0/src/clock.bend: https://jend.leeeet.dev/read.txt?path=ezsys@0.1.0.0/src/clock.bend&start_line=70&end_line=80 import Base # the year, month and day of a day number (days since 1970-01-01) def time.civil(days: U32) -> Ymd: +z = (days + 719468 : U32) +era = (z / 146097 : U32) +doe = (z - era * 146097 : U32) +yoe = ((doe - doe / 1460 + doe / 36524 - doe / 146096) / 365 : U32) +doy = (doe - (365 * yoe + yoe / 4 - yoe / 100) : U32) +mp = ((5 * doy + 2) / 153 : U32) +m = time.civil.month(mp) Ymd{time.civil.year((yoe + era * 400 : U32), m), m, (doy - (153 * mp + 2) / 5 + 1 : U32)} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=Ymd https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.civil.month https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/clock.bend&name=time.civil.year