summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'time.c')
-rw-r--r--time.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/time.c b/time.c
index 3d16676..fe22303 100644
--- a/time.c
+++ b/time.c
@@ -261,15 +261,16 @@ time_arg(argc, argv, tm, usec)
year = obj2long(v[0]);
if (0 <= year && year < 39) {
- year += 2000;
+ year += 100;
rb_warning("2 digits year is used");
}
else if (69 <= year && year < 139) {
- year += 1900;
rb_warning("2 or 3 digits year is used");
}
+ else {
+ year -= 1900;
+ }
- year -= 1900;
tm->tm_year = year;
if (NIL_P(v[1])) {