Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0754356B2 - Calendar device - Google Patents
[go: Go Back, main page]

JPH0754356B2 - Calendar device - Google Patents

Calendar device

Info

Publication number
JPH0754356B2
JPH0754356B2 JP62013515A JP1351587A JPH0754356B2 JP H0754356 B2 JPH0754356 B2 JP H0754356B2 JP 62013515 A JP62013515 A JP 62013515A JP 1351587 A JP1351587 A JP 1351587A JP H0754356 B2 JPH0754356 B2 JP H0754356B2
Authority
JP
Japan
Prior art keywords
day
year
week
month
leap
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP62013515A
Other languages
Japanese (ja)
Other versions
JPS63182592A (en
Inventor
尚孝 藤田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP62013515A priority Critical patent/JPH0754356B2/en
Publication of JPS63182592A publication Critical patent/JPS63182592A/en
Publication of JPH0754356B2 publication Critical patent/JPH0754356B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Electric Clocks (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、時、分、秒の他に年、日、曜日を自動的に計
数、表示するカレンダー装置に関するものである。
TECHNICAL FIELD The present invention relates to a calendar device that automatically counts and displays years, days, and days of the week in addition to hours, minutes, and seconds.

(従来の技術) 従来、この種のカレンダー装置として、例えばデータを
記憶するメモリと、時刻及び日付を修正するための入力
装置と、時刻、日付及び曜日を表示するための表示装置
と、演算処理を行なうと共に前記メモリ、入力装置及び
表示装置を制御する中央処理装置(以下、CPUという)
とを備えたものが提案されている。
(Prior Art) Conventionally, as this type of calendar device, for example, a memory for storing data, an input device for correcting time and date, a display device for displaying time, date and day of the week, and arithmetic processing A central processing unit (hereinafter referred to as a CPU) that controls the memory, the input device, and the display device as well as
Those with and have been proposed.

この種のカレンダー装置は、CPUにより、60秒周期で分
を桁上げし、60分周期で時を桁上げし、12時間あるいは
24時間で1周期の計数動作を行うと共に、7進周期の曜
日表示機能を有し、それを表示装置で表示するものであ
った。また、CPUで日付を計数して月を求め、大の月と
小の月の月末調整をすると共に、2月末日のうるう年調
整をしてそれらを表示装置に表示している。ここで、う
るう年の検出は西暦年号を4で割って割り切れた年がう
るう年という方法で行ない、その検出結果に基づき2月
末日の調整を行なっている。さらに、曜日算出も基準日
からの日数と曜日の対応により求めてそれを表示してい
た。
This type of calendar device uses the CPU to carry the minutes in 60-second cycles and the hour in 60-minute cycles for 12 hours or
In addition to performing a counting operation for one cycle in 24 hours, it has a day display function of a 7-ary cycle and displays it on a display device. In addition, the CPU counts the dates to find the month, adjusts the end of the big month and the end of the small month, and adjusts the leap year at the end of February to display them on the display device. Here, the leap year is detected by a method in which the year that is divided by 4 is the leap year, and the end of February is adjusted based on the detection result. Furthermore, the calculation of the day of the week is also calculated and displayed by the correspondence between the number of days from the reference date and the day of the week.

(発明が解決しようとする問題点) しかしながら、上記構成のカレンダー装置では、時、
分、秒及び7曜周期の曜日を計数し、それを表示するの
は容易であるが、日付表示と月末日より翌月1日に換わ
る計数機能が複雑で、しかも充分なものではなかったた
め、時としてそれらを手動にて修正しなければならず、
不利不便であった。
(Problems to be Solved by the Invention) However, in the calendar device having the above configuration,
It is easy to count the minutes, seconds, and days of the 7-day cycle and display them, but since the date display and the counting function that switches from the last day of the month to the first day of the next month are complicated and not sufficient, You have to manually fix them as
It was a disadvantage.

本発明は前記従来技術が持っていた問題点として、日付
表示と月末日より翌月1日に換わる計数機能の複雑さ
と、それによる修正の必要性の点について解決したカレ
ンダー装置を提供するものである。
SUMMARY OF THE INVENTION The present invention provides a calendar device that solves the problems of the above-mentioned conventional techniques regarding the complexity of the date display and the counting function for changing from the last day of the month to the first day of the next month, and the necessity of correction due to it. .

(問題点を解決するための手段) 本発明は前記問題点を解決するために、メモリと、時刻
及び日付修正用の入力装置と、表示装置と、CPUとを備
えたカレンダー装置において、一定年度期間(例えば、
西暦1904年から西暦2096年までの間)におけるうるう年
とその年の1月1日の曜日との対応データと、1月1日
の曜日に対応する各月初日(1日)の曜日データとを、
前記メモリに格納すると共に、次のような第1〜第5の
処理を前記CPUによって順次実行させるためのプログラ
ムを前記メモリに格納したものである。
(Means for Solving Problems) In order to solve the above problems, the present invention relates to a calendar device including a memory, an input device for time and date correction, a display device, and a CPU, and a fixed year. Period (eg,
Data between leap years in the year 1904 to year 2096) and the day of the week of January 1st of that year, and the day of the week data of the first day of the month (1st) corresponding to the day of the week of January 1st ,
In addition to being stored in the memory, a program for causing the CPU to sequentially execute the following first to fifth processes is stored in the memory.

ここで、第1の処理は午後11時59分から午前0時00分へ
の桁上がり時に日付を1日分加算し、12月32日場合は翌
年1月1日とし、それ以外のときは加算された年月日と
するもの、第2の処理は当該年度がうるう年か否かの判
断を行うと共に、当該年度がうるう年でない場合には当
該年度に近いうるう年の年度を求めるもの、第3の処理
は当該年度がうるう年の場合は前記対応データに基づき
当該年度の1月1日の曜日を求め、当該年度がうるう年
でない場合は当該年度に近いうるう年の年度と前記対応
データに基づき当該年度の1月1日の曜日を求めるもの
である。また、第4の処理は第1の処理における加算結
果の月末補正を行い、当該年度の月及び日を求め、さら
に前記曜日データに基づき当該月の初日の曜日を求める
もの、第5の処理は当該日付の曜日を求めるものであ
る。
Here, the first process is to add the date by one day when the carry is made from 11:59 pm to 0:00 am, and if it is December 32, the date is January 1, the following year, otherwise. The second processing determines whether or not the year is a leap year, and if the year is not a leap year, a year that is close to the year is requested, and the third processing If the year is a leap year, the day of the week of January 1 of the year is calculated based on the corresponding data. If the year is not a leap year, the leap year close to the year and January of the year based on the corresponding data. It asks for the day of the week. In the fourth processing, the addition result in the first processing is corrected at the end of the month, the month and day of the year are calculated, and the first day of the month is calculated based on the day of the week data. The fifth processing is The day of the week on the date is calculated.

(作 用) 本発明によれば、以上のようにカレンダー装置を構成し
たので、第1〜第5の処理プログラムをCPUにより実行
させることにより、うるう年判定と曜日算出が容易にな
り、それによって毎日の日付表示と月末日より翌月1日
に至る日換わり動作の無修正化が可能となる。従って前
記問題点を除去できるのである。
(Operation) According to the present invention, since the calendar device is configured as described above, by executing the first to fifth processing programs by the CPU, leap year determination and day of the week calculation are facilitated, and thereby, every day. It is possible to display the date and change the daily change operation from the end of the month to the first of the following month. Therefore, the above problems can be eliminated.

(実施例) 第1図は本発明の実施例を示すカレンダー装置の動作フ
ローチャート、特にうるう年変換/月、日加算/曜日算
出の動作が詳細に示されている。第2図は第1図の動作
を行うカレンダー装置の概略構成図である。
(Embodiment) FIG. 1 shows in detail an operation flowchart of a calendar device showing an embodiment of the present invention, in particular, leap year conversion / month, day addition / day of week calculation operation. FIG. 2 is a schematic configuration diagram of a calendar device that performs the operation of FIG.

第2図に示すカレンダー装置は、時刻及び日付計数用の
マイクロコンピュータ1を有し、そのマイクロコンピュ
ータ1には入力装置である時刻及び日付修正用キー2と
出力装置である時刻、日付及び曜日表示用の表示装置3
とが接続されている。マイクロコンピュータ1は各種の
演算処理等を行うCPUと、フラグを有し第1図の動作フ
ローチャート実行用のプログラムや読出し専用メモリデ
ータ(以下、ROMデータという)を記憶するメモリとを
備えている。このマイクロコンピュータ1中のCPUは、
メモリに格納されたプログラムに従って入力基準信号φ
を基に秒、分、時、月、日を計数し、24時間計の場合に
は23時59分から0時00分になったときに、または12時間
計の場合には午後11時59分から午後0時00分になったと
きに日付を自動的に計数する機能等を有している。コン
ピュータ1から出力された時刻、日付、曜日は、表示装
置3で表示される。
The calendar device shown in FIG. 2 has a microcomputer 1 for counting time and date, and the microcomputer 1 has a time and date correction key 2 as an input device and a time, date and day of the week display as an output device. Display device 3
And are connected. The microcomputer 1 includes a CPU that performs various kinds of arithmetic processing and the like, and a memory that has a flag and that stores a program for executing the operation flowchart of FIG. 1 and read-only memory data (hereinafter referred to as ROM data). The CPU in this microcomputer 1 is
Input reference signal φ according to the program stored in the memory
Seconds, minutes, hours, months, and days are counted based on, and the time from 23:59 to 0:00 for a 24-hour counter, or from 11:59 pm for a 12-hour counter It has a function to automatically count the date when it is 0:00 pm. The time, date, and day of the week output from the computer 1 are displayed on the display device 3.

第3図はうるう年と1月1日の曜日との対応データを示
す図である。この図では、例えば西暦1904年から西暦20
99年のうるう年とその年1月1日の曜日との対応関係が
示されている。ここで、Z0はうるう年の1月1日の曜日
の周期、Zはその各曜日に対応させた数字データであ
る。
FIG. 3 is a diagram showing correspondence data between a leap year and a day of the week of January 1. In this figure, for example, 1904 to 20
The correspondence between the leap year of 1999 and the day of the week of January 1st of that year is shown. Here, Z 0 is the day of the week on the first day of the leap year, and Z is numerical data corresponding to each day of the week.

第3図から明らかなように、西暦1904年からうるう年1
月1日の曜日は24年周期となっている。そしてこのよう
な第3図の対応データを第2図のマイクロコンピュータ
1中のメモリに予め格納しておく。
As is clear from Figure 3, leap year 1 from 1904
The day of the week on the first day of the month has a cycle of 24 years. Then, such corresponding data of FIG. 3 is stored in advance in the memory in the microcomputer 1 of FIG.

第4図は第3図における数字データZと曜日との対応図
である。
FIG. 4 is a correspondence diagram between the numerical data Z and the day of the week in FIG.

第5図は1月1日の曜日に対応する各月1日の曜日デー
タを示す図である。なお、図中の( )内はうるう年の
ときの曜日を示している。この図から明らかなように、
各年1月1日の曜日から各月1日の曜日は簡単に判明す
る。そしてこのような曜日データも第2図のマイクロコ
ンピュータ1中のメモリに予め格納しておく。
FIG. 5 is a diagram showing the day of the week data of each month corresponding to the day of the week of January 1. In addition, () in the figure shows the day of the week in a leap year. As you can see from this figure,
The day of the week on January 1st of each year can be easily found. Such day-of-week data is also stored in advance in the memory of the microcomputer 1 shown in FIG.

また、各月1日が日曜日の場合、10日は必ず火曜日、20
日は必ず金曜日、30日は必曜日となる。このような対応
関係は第4図の数字データZを用いれば、その数字デー
タZの差分として簡単に表現できる。
If the first day of each month is Sunday, the 10th must be Tuesday and 20
The day is always Friday, and the 30th is a must. Such correspondence can be easily expressed as a difference of the numerical data Z by using the numerical data Z of FIG.

次に、第1図を参照しつつ第2図のカレンダー装置の自
動日付計数動作を説明する。
Next, the automatic date counting operation of the calendar device of FIG. 2 will be described with reference to FIG.

第1図のフローチャートは第1〜第5の処理手順からな
り、第2図のマイクロコンピュータ1が従来と同様に60
秒周期で分を桁上げし、60分周期で時を桁上げし、12時
間または24時間で1周期する計数動作を行い、12時間計
では午後11時59分から午前12時00分への桁上がり時に、
24時間計では23時59分から0時00分への桁上がりの時に
第1の処理が開始する。
The flowchart of FIG. 1 includes the first to fifth processing procedures, and the microcomputer 1 of FIG.
Carry out the minutes in seconds, carry the hours in 60 minutes, and perform one counting operation in 12 hours or 24 hours. In the 12-hour counter, the digits from 11:59 pm to 12:00 am When rising,
In the 24-hour counter, the first process starts at the carry from 23:59 to 0:00.

第1の処理は、ステップ10〜13からなり、先ずステップ
10で日付を加算し、次いでステップ11で12月32日か否か
の判断を行ない、12月32日の場合にはステップ12で1年
を加算して翌年1月1日にセットし、12月32日以外のと
きには加算された年、月、日のまま、共にステップ13へ
進む。ステップ13では1904年にxに、当該年度すなわち
現在年をyに、うるう年1月1日の曜日の周期Z0を0に
それぞれして初期データのセットを行い、第2の処理へ
進む。
The first process consists of steps 10 to 13, and the first step is
In step 11, the date is added, and then in step 11, it is judged whether it is December 32 or not. If it is December 32, the year is added in step 12 and set on January 1 of the following year. If it is other than the 32nd of the month, proceed to step 13 together with the added year, month and day. In step 13, initial data is set in x in 1904, y in the current year, that is, the current year, and 0 in the cycle Z 0 of the day of the week of January 1 of the leap year, and the second process is performed.

第2の処理はステップ20〜25と、そのステップ20から分
岐するステップ26と、そのステップ21から分岐するステ
ップ27〜31とで構成され、ステップ20〜25で現在年yが
うるう年であるか否かの判断を行ない、うるう年の場合
にはステップ26でマイクロコンピュータ1中のメモリの
うるう年フラグをセットして第3の処理へ進み、うるう
年でない場合にはステップ27〜31で現在年yより少なく
かつ最も近いうるう年が何年であるかを判断して第3の
処理へ進む。
The second process is composed of steps 20 to 25, step 26 branching from step 20 and steps 27 to 31 branching from step 21. In steps 20 to 25, it is determined whether the current year y is a leap year. If it is a leap year, the leap year flag of the memory in the microcomputer 1 is set in step 26 to proceed to the third processing. If it is not a leap year, in steps 27-31 it is less than the current year y and It is determined which year is the closest leap year, and the process proceeds to the third processing.

第3の処理はステップ41〜45で構成され、ステップ41で
現在年yがうるう年か否かの判断を行ない、うるう年の
場合にはマイクロコンピュータ1中のメモリに格納され
た第3図の対応データから現在年yの1月1日の曜日が
判定できるので、第1図の記号xで示すように第4の処
理へ進む。ステップ41で現在年yがうるう年でない場合
にはステップ42〜45により、第2の処理で求めた最も近
いうるう年の1月1日の曜日における第3図の周期Z0
第4図の数字データZとを対応させ、その数字データZ
を現在年yに対応させて変更する。これにより現在年y
の1月1日の曜日が判定するので、第4の処理へ進む。
The third process is composed of steps 41 to 45. In step 41, it is judged whether or not the current year y is a leap year, and if it is a leap year, the corresponding data of FIG. 3 stored in the memory of the microcomputer 1. Since the day of the week of January 1 of the current year y can be determined, the process proceeds to the fourth process as indicated by the symbol x in FIG. If the current year y is not a leap year in step 41, steps 42 to 45 perform the cycle Z 0 of FIG. 3 and the numerical data of FIG. 4 on the day of January 1 of the closest leap year obtained in the second process. Corresponds to Z and the numerical data Z
To correspond to the current year y. This makes the current year y
Since the day of the week of January 1 is determined, the process proceeds to the fourth process.

第4の処理はステップ50〜54で構成され、ステップ50に
よりうるう年を含めて第1の処理で加算した月、日の月
末補正の処理を行なう。例えば、うるう年の場合には2
月28日を2月29日、2月29日を3月1日のように各月の
月末補正を行なう。ここで現在の年、月、日が確定され
るので、ステップ51ではマイクロコンピュータ1中のメ
モリに格納された第5図の曜日データから現在月、日が
何月かを判断し、ステップ52のうるう年か否かの判断を
経てうるう年でない場合にはステップ54へ進み、うるう
年の場合にはステップ53により該当月の1日からの曜日
差分値aに1を加算してステップ54へ進む。ステップ54
では該当月の1日の曜日差分値aを該当年1月1日の数
字データZに7進補正加算(Z+a)を行なう。これで
現在年、月、日の該当月1日の曜日が判断でき、第5の
処理へ進む。
The fourth processing is composed of steps 50 to 54, and at the step 50, the month and day end correction processing including the leap year added in the first processing is performed. For example, 2 for leap years
The month end correction of each month is performed like 28th of February, 29th of February, and 1st of March of February 29. Since the current year, month, and day are determined here, in step 51, it is judged from the day of the week data shown in FIG. If it is not a leap year after judging whether or not it is a leap year, the routine proceeds to step 54, and if it is a leap year, step 53 adds 1 to the day difference value a from the first day of the relevant month and proceeds to step 54. Step 54
Then, the day difference value a on the 1st day of the relevant month is added to the numerical data Z on the 1st day of the relevant year by the seven-digit correction (Z + a). With this, the day of the week corresponding to the current year, month, and day can be determined, and the process proceeds to the fifth process.

第5の処理は、ステップ60,61,62−1〜62−4,63で構成
され、該当年、月、日の月、日データを基にステップ60
で日の1位桁の曜日差分値bを求め、次いでステップ61
により日の10位桁の曜日差分値cを判断し、その曜日差
分cに基づきステップ60−1〜62−4で7進補正加算値
Eを求め、さらにステップ63で数字データZと加算値E
との7進補正加算を行なう。これにより当該日の曜日が
判定できるので、日付の計数動作が終了する。日付の計
数動作が終了すると、マイクロコンピュータ1は現在の
年、月、日、曜日を表示装置3に表示させる。この表示
装置3では従来と同様に時刻表示も行われる。
The fifth processing is composed of steps 60, 61, 62-1 to 62-4, 63, and based on the relevant year, month, day, month, day data, step 60.
Then, the day difference value b of the first digit of the day is calculated, and then step 61
The day difference value c of the tenth digit of the day is determined by the following, based on the day difference c, the seven-decimal correction addition value E is obtained in steps 60-1 to 62-4, and the numerical data Z and the addition value E are calculated in step 63.
And 7-ary correction addition is performed. As a result, the day of the week can be determined, and the date counting operation is completed. Upon completion of the date counting operation, the microcomputer 1 causes the display device 3 to display the current year, month, day and day of the week. The display device 3 also displays the time as in the conventional case.

ここで、日付計数動作の二つの具体例(1),(2)を
説明する。
Here, two specific examples (1) and (2) of the date counting operation will be described.

(1)西暦1987年2月12日(木)午後11時59分から2月
13日(金)午前0時00分への日付計数動作(i)第1の
処理 ステップ10で2月12日に+1日して2月13日となる。ス
テップ11で12月32日否かの判断を行ない、12月32日でな
いためステップ13へ移り、このステップ13で初期データ
をセットして基準年x=1904年、うるう年1月1日の曜
日の周期Z0=0、現在年y=1987年とする。
(1) February 12, 1987 (Thursday) 11:59 pm to February
Date counting operation at 0:00 am on 13th (Friday) (i) First processing In step 10, February 12 is incremented by +1 to February 13. In step 11, it is judged whether it is December 32 or not. Since it is not December 32, the process moves to step 13, and in this step 13, the initial data is set to set the base year x = 1904, the day of the week of January 1, leap year. The cycle Z 0 = 0 and the current year y = 1987.

(ii)第2の処理 ステップ20でx=yか否かの判断を行い、1904≠1987の
ためステップ21へ移り、このステップ21でy<xか否か
の判断で行なう。y=1987>x=1904のためにステップ
22でx+4=1904+4=1908の加算を行ない、さらにス
テップ23で周期Z0の加算を行ない、Z0=Z0+1=0+1
=1とした後、ステップ24でその周期Z0(=1)が7か
否かの判断を行なう。Z0≠7のためにステップ20へ戻
り、前記動作を繰り返す。ステップ20〜25の動作を複数
回繰り返し、基準年x=1988になると、ステップ20を通
してステップ21へ移り、このステップ21でy=1987<x
=1988となるため、ステップ27へ移る。ステップ20から
ステップ26へ移らずに、ステップ21,27へ移動したとい
うことは、現在年y=1987がうるう年ではなく、平年だ
ということが判断されたことである。なお、この際ステ
ップ25で周期Z0が0にセットされている。
(Ii) Second processing In step 20, it is determined whether x = y. Since 1904 ≠ 1987, the process proceeds to step 21. In step 21, it is determined whether y <x. Step for y = 1987> x = 1904
In step 22, x + 4 = 1904 + 4 = 1908 is added, and in step 23, the cycle Z 0 is added, and Z 0 = Z 0 + 1 = 0 + 1
After setting = 1, it is determined in step 24 whether the cycle Z 0 (= 1) is 7. Since Z 0 ≠ 7, the process returns to step 20 and the above operation is repeated. The operations of steps 20 to 25 are repeated a plurality of times, and when the reference year x = 1988, the process moves to step 21 through step 20, and in this step 21, y = 1987 <x
== 1988, so move to step 27. Moving from step 20 to step 26 without moving to step 26 means that the current year y = 1987 is a normal year, not a leap year. At this time, the cycle Z 0 is set to 0 in step 25.

ステップ27でメモリの平年フラグをセットした後、ステ
ップ28で基準年x(=1988年)の減算を行ない、x=x
−4=1988−4=1987とし、さらにステップ29で周期Z0
(=0)の減算を行ない、Z0=Z0−1=0−1=−1と
してステップ30へ移る。ステップ3では周期Z0=−1か
否かの判断を行い、イエスのためにステップ31で周期Z0
(=−1)が6にセットされる。このステップ27〜31の
動作により、現在年y=1987よりも少なく、かつ最も近
いうるう年が1984年であると判断されたことになる。
After the average year flag of the memory is set in step 27, the reference year x (= 1988) is subtracted in step 28, and x = x
-4 = 1988-4 = 1987, and in step 29, the cycle Z 0
(= 0) is subtracted, Z 0 = Z 0 −1 = 0−1 = −1 is set, and the process proceeds to step 30. In step 3, it is judged whether or not the cycle Z 0 = -1, and because of yes, in step 31, the cycle Z 0 =
(= -1) is set to 6. By the operations of steps 27 to 31, it is determined that the leap year that is less than the current year y = 1987 and is the closest is 1984.

(iii)第3の処理 ステップ40で周期Z0の値を判断し、Z0=6のため、その
周期Z0を0にセットし、第2の処理で求めたうるう年x
(=1984年)の1月1日の曜日における第3図の周期Z0
値と第4図の数字データZ値とを対応させる。次にステ
ップ41では現在年y=1987がうるう年か否かの判断を行
ない、平年であるためステップ42に移り、ステップ40に
おけるZ0=6のときの第3図の数字データZ=0に対し
てステップ42で+1加算を行なってZ=Z+1=0+1
=1とした後、さらにステップ43で数字データZの+1
加算を行ってZ=Z+1=1+1=2とする。このステ
ップ42,43では7進補正の加算動作を行なう。次にステ
ップ44において現在年y=1987年の−1減算を行ない、
y=y−1=1987−1=1986とした後、ステップ45でx
=yか否かの判断を行なう。x=1984、y=1986のた
め、ステップ42へ戻り、前記ステップ42〜45の動作を複
数回繰り返す。y=1984、Z=4になると、ステップ45
でx=1984=yとなり、第4の処理へ進む。このステッ
プ42〜45では平年時における数字データZを現在年1987
に対応させて変更し、現在年1987における1月1日の曜
日(=木)を判定している。
(Iii) Third processing In step 40, the value of the cycle Z 0 is determined, and since Z 0 = 6, the cycle Z 0 is set to 0, and the leap year x obtained in the second processing x
Cycle Z 0 in Fig. 3 on the day of January 1st (= 1984)
The value is associated with the numerical data Z value in FIG. Next, at step 41, it is judged whether or not the current year y = 1987 is a leap year. Since it is a normal year, the routine proceeds to step 42, where the numerical data Z = 0 in FIG. 3 when Z 0 = 6 at step 40 Then, in step 42, +1 is added to Z = Z + 1 = 0 + 1.
After setting = 1, in step 43, the numerical data Z is incremented by +1
Addition is performed to set Z = Z + 1 = 1 + 1 = 2. In steps 42 and 43, the addition operation of the 7-ary correction is performed. Next, in step 44, the current year y = 1987 minus -1 is subtracted,
After setting y = y-1 = 1987-1 = 1986, in step 45, x
= Y is determined. Since x = 1984 and y = 1986, the process returns to step 42 and the operations of steps 42 to 45 are repeated a plurality of times. When y = 1984 and Z = 4, step 45
Then x = 1984 = y, and the process proceeds to the fourth process. In these steps 42 to 45, the numerical data Z in the normal year is set to the current year 1987.
The current day of January 1987 is determined as the day of the week (= Thursday).

(iv)第4の処理 ステップ50ではステップ10で加算した月、日の月末処理
を行なうが、ステップ10の加算結果が2月13日であるた
め、月末処理を行なわずにステップ51へ移り、このステ
ップ51へ移り、このステップ51で何月かを判断する。2
月であるため、該当月(=2)の1日の曜日差分値a=
3としてステップ54で該当年(=1987)の1月1日にお
ける数字データZの7進補正加算Z=z+a=4+3=
7→0を行う。第4図から数字データZ=0は日曜日で
あるため、現在年(1987)における2月1日の曜日(=
日)が判定できる。
(Iv) Fourth process In step 50, the end of the month and day added in step 10 is processed. However, since the result of addition in step 10 is February 13, the end of month processing is skipped and the process proceeds to step 51. The process moves to this step 51, and this step 51 determines the month. Two
Since it is a month, the day-of-the-week difference value a of the corresponding month (= 2) is a =
As step 3, in step 54, the seven-digit correction addition of the numerical data Z on January 1 of the corresponding year (= 1987) Z = z + a = 4 + 3 =
Perform 7 → 0. From FIG. 4, since the numerical data Z = 0 is Sunday, the day of the week (February 1) in the current year (1987) (=
Date) can be determined.

(v)第5の処理 この処理は2月13日の曜日を判定するもので、先ずステ
ップ60で13日における日1位桁「3」に対する曜日差分
値b=3を求め、次にステップ61で13日における日10位
桁の曜日差分値C=1を求め、それに対応するステップ
62−2で7進補正加算値E=b+2=3+2=5を算出
する。その後ステップ63で数字データの7進補正加算Z
=Z+E=0+5=5を行ない、この数字データZ=5
を基に第4図から13日が金曜日と判定でき、日付計数動
作を終了する。
(V) Fifth processing This processing is to determine the day of the week on February 13, firstly in step 60, the day difference value b = 3 for the 1st digit “3” of the day on the 13th is obtained, and then in step 61. Calculate the day difference value C = 1 of the 10th place of the day on the 13th, and the corresponding step
In 62-2, the 7-ary correction addition value E = b + 2 = 3 + 2 = 5 is calculated. After that, in step 63, the seven-digit correction addition Z
= Z + E = 0 + 5 = 5, and this numerical data Z = 5
From FIG. 4, it can be determined that the 13th day is Friday, and the date counting operation is ended.

(2)西暦1988年(うるう年)2月29日(月)午後11時
59分から3月1日(火)午後0時00分への日付計数動作 (i)第1の処理 ステップ10で2月29日に+1日加算すると、2月30日と
なり、ステップ13でx=1904年、y=1988年、Z0=0を
セットする。
(2) 19:00 pm, Monday, February 29, 1988 (leap year)
Date counting operation from 59 minutes to 0:00 pm on Tuesday, March 1st (i) First processing If +1 day is added to February 29th in step 10, it becomes February 30th, and x = in step 13 1904, y = 1988, set Z 0 = 0.

(ii)第2の処理 ステップ20〜25を複数回繰り返し、x=1988、Z0=0に
なると、ステップ20の判断x=yがイエスとなり、うる
う年と判断されてステップ26でメモリのうるう年フラグ
がセットされ、第2の処理へ進む。
(Ii) Second processing Steps 20 to 25 are repeated a plurality of times, and when x = 1988 and Z 0 = 0, the determination x = y in step 20 becomes YES, it is determined to be a leap year, and in step 26, the leap year flag in the memory. Is set and the process proceeds to the second process.

(iii)第3の処理 ステップ40ではZ0=0であるためにZ=5にセットさ
れ、ステップ41のうるう年判断でイエスとなり、符号x
で示すように第4の処理へ進む。
(Iii) Third process Since Z 0 = 0 in step 40, it is set to Z = 5, and the leap year determination in step 41 results in YES, and the code x
The process proceeds to the fourth process as shown by.

(iv)第4の処理 ステップ50で月末処理されるため、2月30日が3月1日
と補正され、ステップ51で3月に対応する曜日差分値a
=3が求められる。次にステップ52のうるう年判断がイ
エスのため、ステップ53で曜日差分値aに対する7進補
正加算a=a+1=3+1=4が行われた後、ステップ
54で数字データZの7進補正加算Z=Z+a=5+4=
9→2が行なわれる。
(Iv) Fourth processing Since the end of the month processing is performed in step 50, February 30 is corrected to March 1, and in step 51 the day difference value a corresponding to March is set.
= 3 is required. Next, since the leap year determination in step 52 is YES, in step 53, the seven-digit correction addition a = a + 1 = 3 + 1 = 4 for the day of the week difference value a is performed.
At 54, the 7-digit correction addition of the numerical data Z Z = Z + a = 5 + 4 =
9 → 2 is performed.

(v)第5の処理 ステップ60では3月1日のためにその日1位桁に対する
曜日差分値b=1が求められ、次いでステップ61で日10
位桁の曜日差分値c=0となり、ステップ62−1で7進
補正加算E=b+6=1+6=7→0が行われる。その
後、ステップ63で数字データZの7進補正加算Z=Z+
E=2+0=2が行なわれ、3月1日が火曜日と判定さ
れ、日付計数動作を終了する。
(V) Fifth processing In step 60, the day difference value b = 1 for the first digit of the day is obtained for March 1st, and then in step 61, the day 10
The day difference value c of the place digit becomes 0, and the 7-ary correction addition E = b + 6 = 1 + 6 = 7 → 0 is performed in step 62-1. After that, in step 63, the 7-digit correction addition of the numerical data Z is performed Z = Z +
E = 2 + 0 = 2 is performed, it is determined that March 1st is Tuesday, and the date counting operation is ended.

本実施例では、メモリに予め格納したプログラムを実行
することにより、西暦1904ね年から2099年までのうるう
年判定と曜日算出が容易に行なえ、それによってうるう
年及び曜日無修正のオートカレンダー装置を提供でき
る。また、本実施例のうるう年/曜日算出の処理手順
は、時計やその他の自動日付装置等、種々のものに適用
可能である。
In the present embodiment, by executing the program stored in advance in the memory, it is possible to easily determine the leap year from 1904 to 2099 AD and calculate the day of the week, thereby providing an automatic calendar device with no leap year and day of the week correction. . Also, the processing procedure for calculating the leap year / day of the present embodiment can be applied to various things such as a clock and other automatic date devices.

なお、本発明は図示の実施例に限定されず、例えば計数
年度を西暦2099年以上の期間に適用可能なように第1図
の動作フローチャートを変形する等、種々変形が可能で
ある。
The present invention is not limited to the illustrated embodiment, and various modifications can be made, for example, by modifying the operation flowchart of FIG. 1 so that the counting year can be applied to a period of the year 2099 or more.

(発明の効果) 以上詳細に説明したように、本発明によれば、第1〜第
5の処理プログラムをメモリに格納したので、そのプロ
グラムをCPUにより実行させることにより、複雑な計数
機能を必要とするうるう年判定と曜日算出の計数を、簡
素化できると共に容易かつ正確に行なうことができる。
従って、毎日の日付表示と月末日より翌月1日に至る日
換わり動作の無修正化という効果が期待できる。
(Effects of the Invention) As described in detail above, according to the present invention, since the first to fifth processing programs are stored in the memory, a complicated counting function is required by executing the programs by the CPU. The leap year determination and the calculation of the day of the week can be simplified and easily and accurately performed.
Therefore, it is possible to expect an effect that the daily display and the daily change operation from the last day of the month to the first day of the next month are uncorrected.

【図面の簡単な説明】[Brief description of drawings]

第1図は本発明の実施例を示すカレンダー装置の動作フ
ローチャート、第2図は第1図の動作を行なうカレンダ
ー装置の概略構成図、第3図はうるう年と1月1日の曜
日との対応データを示す図、第4図は曜日とその数字デ
ータを示す図、第5図は1月1日の曜日に対応する各月
1日の曜日データを示す図である。 1……マイクロコンピュータ、2……時刻及び日付修正
用キー、3……表示装置。
FIG. 1 is an operation flowchart of a calendar device showing an embodiment of the present invention, FIG. 2 is a schematic configuration diagram of a calendar device for performing the operation of FIG. 1, and FIG. 3 is a correspondence between a leap year and a day of the week of January 1. FIG. 4 is a diagram showing the data, FIG. 4 is a diagram showing the day of the week and its numerical data, and FIG. 5 is a diagram showing the day of the week data of each month corresponding to the day of the week of January 1. 1 ... Microcomputer, 2 ... Time and date correction key, 3 ... Display device.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】データを記憶するメモリと、時刻及び日付
を修正するための入力装置と、時刻、日付及び曜日を表
示するための表示装置と、演算処理を行なうと共に前記
メモリ、入力装置及び表示装置を制御する中央処理装置
とを備えたカレンダー装置において、 一定年度期間におけるうるう年とその年の1月1日の曜
日との対応データと、1月1日の曜日に対応する各月初
日の曜日データとを、前記メモリに格納すると共に、 午後11時59分から翌日午前0時00分への桁上がり時に日
付を1日分加算し、12月32日の場合は翌年1月1日と
し、それ以外のときは加算された年月日とする第1の処
理と、 当該年度がうるう年か否かの判断を行うと共に、当該年
度がうるう年でない場合には当該年度に近いうるう年の
年度を求める第2の処理と、 当該年度がうるう年の場合は前記対応データに基づき当
該年度の1月1日の曜日を求め、当該年度がうるう年で
ない場合は当該年度に近いうるう年の年度と前記対応デ
ータに基づき当該年度の1月1日の曜日を求める第3の
処理と、 前記第1の処理における加算結果の月末補正を行い、当
該年度の月及び日を求め、さらに前記曜日データに基づ
き当該月の初日の曜日を求める第4の処理と、 当該日付の曜日を求める第5の処理とを、 前記中央処理装置により順次実行させるためのプログラ
ムを前記メモリに格納したことを特徴とするカレンダー
装置。
1. A memory for storing data, an input device for correcting time and date, a display device for displaying time, date and day of the week, and a memory for performing arithmetic processing and the memory, input device and display. In a calendar device having a central processing unit for controlling the device, correspondence data between a leap year in a fixed year period and a day of the week of January 1 of the year, and a day of the first day of each month corresponding to the day of the week of January 1 The data and are stored in the memory, and the date is added by one day at the time of the carry from 11:59 pm to 0:00 am the next day. If it is December 32, it will be January 1 of the following year. Other than the above, the first processing is performed with the date added, and whether or not the year is a leap year is determined, and when the year is not a leap year, the year leap year close to the year is requested. Processing of the If the degree is a leap year, the day of the week of January 1 of the relevant year is calculated based on the correspondence data. If the year is not a leap year, the leap year that is close to the year and January 1 of the year based on the correspondence data. The third process for determining the day of the week and the month end correction of the addition result in the first process to determine the month and day of the year, and the fourth day of the week for the first day of the month based on the day of the week data. A calendar device, wherein a program for causing the central processing unit to sequentially execute a process and a fifth process for determining a day of the week of the date is stored in the memory.
JP62013515A 1987-01-23 1987-01-23 Calendar device Expired - Lifetime JPH0754356B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62013515A JPH0754356B2 (en) 1987-01-23 1987-01-23 Calendar device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62013515A JPH0754356B2 (en) 1987-01-23 1987-01-23 Calendar device

Publications (2)

Publication Number Publication Date
JPS63182592A JPS63182592A (en) 1988-07-27
JPH0754356B2 true JPH0754356B2 (en) 1995-06-07

Family

ID=11835286

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62013515A Expired - Lifetime JPH0754356B2 (en) 1987-01-23 1987-01-23 Calendar device

Country Status (1)

Country Link
JP (1) JPH0754356B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116149160B (en) * 2023-01-10 2025-06-20 均胜群英(南京)新能源汽车系统研究院有限公司 A system time timing method based on vehicle charging pile

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS54104875A (en) * 1978-02-03 1979-08-17 Seiko Epson Corp Day judging circuit

Also Published As

Publication number Publication date
JPS63182592A (en) 1988-07-27

Similar Documents

Publication Publication Date Title
JPH0754356B2 (en) Calendar device
JP3674957B2 (en) Calendar display device
JP2001282344A (en) Method and system for making production plan of tact production
JP3328814B2 (en) Timetable display device and timetable display control method
JP3109132B2 (en) Time setting device
JPS5831552B2 (en) How to display an electronic clock
JP2534326B2 (en) Weekly schedule display device
JPH0720634Y2 (en) Date data storage device
JPH02311788A (en) Monthly data calculation device
JPS62143170A (en) Schedule input device
JPS5824235Y2 (en) Elephant starfish
JPH055515Y2 (en)
JPH04362684A (en) Electronic equipment with day-of-the week display
JPH0726761Y2 (en) Data storage
JP2001519912A (en) Chronometer
JPH0134149Y2 (en)
JPS5937479B2 (en) clock with calendar
JPH0664192U (en) Time display device
JPH082701Y2 (en) Calendar display
JP5970630B1 (en) Indefinite time clock
JPH0726760Y2 (en) Alarm time data storage device
JPH09146891A (en) Device and method for calculating day of week handling entire christian era
JPS5857717B2 (en) How to display an electronic clock
JPH0555171U (en) Day creation device
JPH10153671A (en) Day setting device and day setting method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term