oga's tools
Révision | 53274d33323923d3d56272164cf0374ad7f875c5 (tree) |
---|---|
l'heure | 2023-09-23 13:08:15 |
Auteur | hyperoga <hyperoga@gmai...> |
Commiter | hyperoga |
2023/05/03 V1.01 support reiwa
@@ -1,6 +1,7 @@ | ||
1 | 1 | /* |
2 | 2 | * 和暦を西暦に変換 |
3 | 3 | * 本日時点での年齢表示 |
4 | + * 2023/05/03 V1.01 support reiwa | |
4 | 5 | */ |
5 | 6 | #include <stdio.h> |
6 | 7 | #include <string.h> |
@@ -12,13 +13,13 @@ | ||
12 | 13 | #endif |
13 | 14 | |
14 | 15 | |
15 | -char *gengou[] = { "西暦" , "明治", "大正", "昭和", "平成" }; | |
16 | -int gannen[] = { 1, 1868, 1912, 1926, 1989 }; | |
16 | +char *gengou[] = { "西暦" , "明治", "大正", "昭和", "平成", "令和" }; | |
17 | +int gannen[] = { 1, 1868, 1912, 1926, 1989 , 2019 }; | |
17 | 18 | |
18 | 19 | |
19 | 20 | void usage() |
20 | 21 | { |
21 | - printf("usage: age {Myy|Tyy|Syy|Hyy|yyyy}[/mm/dd]\n"); | |
22 | + printf("usage: age {Myy|Tyy|Syy|Hyy|Ryy|yyyy}[/mm/dd]\n"); | |
22 | 23 | printf(" /mm/dd : birth day (If specified, display age.)\n"); |
23 | 24 | exit(1); |
24 | 25 | } |
@@ -58,6 +59,10 @@ int main(int a, char *b[]) | ||
58 | 59 | org_year = gannen[4]; /* 平成元年 */ |
59 | 60 | wareki = 1; |
60 | 61 | break; |
62 | + case 'R': | |
63 | + org_year = gannen[5]; /* 令和元年 */ | |
64 | + wareki = 1; | |
65 | + break; | |
61 | 66 | default: |
62 | 67 | if (strlen(ge) >= 4 && |
63 | 68 | ge[0] >= '0' && ge[0] <= '9' && |