ГОСТ Р ИСО 15535—2012
D.2 Текст программы представления даты и возраста в виде десятичного числа
Function agecalc (examyear. exammonth. examdate, birthyear, birthmonth. birthdate)
Dim Cexam As Integer. Dim CbirthAs Integer
If exammonth = 1Then Cexam = 0
If exammonth = 2 Then Cexam = 31
If exammonth = 3 Then Cexam = 59
If exammonth = 4 Then Cexam = 90
If exammonth = 5 Then Cexam = 120
If exammonth = 6 Then Cexam = 151
If exammonth = 7 Then Cexam = 181
If exammonth = 8 Then Cexam = 212
If exammonth = 9 Then Cexam = 243
If exammonth = 10 Then Cexam = 273
If exammonth = 11 Then Cexam = 304
If exammonth = 12 Then Cexam = 334
If birthmonth = 1Then Cbirth = 0
If birthmonth = 2 Then Cbirth = 31
If birthmonth = 3 Then Cbirth = 59
If birthmonth = 4 Then Cbirth = 90
If birthmonth = 5 Then Cbirth = 120
If birthmonth = 6 Then Cbirth = 151
If birthmonth = 7 Then Cbirth = 181
If birthmonth = 8 Then Cbirth = 212
If birthmonth = 9 Then Cbirth = 243
If birthmonth = 10 Then Cbirth =273
If birthmonth = 11 Then Cbirth = 304 If
birthmonth = 12Then Cbirth =334
If birthmonth =2 And birthdate =29 Then birthdate =28 (Этоозначает что 02-29 считают как 02-28 для Birthdate)
If exammonth = 2 And examdate = 29 Then examdate = 28 (Это означает что 02-29 считают как 02-28 для
Examdate)
agecalc=examyear-birthyear +(Cexam + examdate - Cbirth - birthdatey365
End Funt ion
Примечание — Коммерчески доступное программное обеспечение, такое как электронные таблицы, мо
жет быть использовано для решения проблем, связанных с високосным годом.
11