Path: galaxy.trc.rwcp.or.jp!news.trc!imnet3!news.imnet.ad.jp!news.join.ad.jp!Q.T.Honey!rim.or.jp!t3.rim.or.jp!kt.rim.or.jp!not-for-mail
From: Tadayoshi Funaba <tadf@kt.rim.or.jp>
Newsgroups: fj.unix,fj.unix.shells,fj.questions.unix
Subject: Re: calculate date
Date: 27 Jul 1999 20:20:44 +0900
Organization: RIMNET
Lines: 92
Message-ID: <19990727202044U.tadf@kt.rim.or.jp>
References: <7nhgtt$r9f$1@sn.asahi-net.email.ne.jp>
NNTP-Posting-Host: ppp036.kt.rim.or.jp
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
In-Reply-To: Your message of "26 Jul 1999 20:31:04 +0900"
	<7nhgtt$r9f$1@sn.asahi-net.email.ne.jp>
X-Mailer: xcite1.27> Mew version 1.93 on Emacs 19.28 / Mule 2.3 (SUETSUMUHANA)
X-Dispatcher: imput version 980905(IM100)
Xref: galaxy.trc.rwcp.or.jp fj.unix:11126 fj.questions.unix:9657
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.questions.unix&nb=9657&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B$U$J$P$H?=$7$^$9!#(B

At 1999-07-26T20:31:04+0900 (2451385.97991JD),
sn@asahi-net.email.ne.jp (Seiichi Namba) wrote:

sn> $B$3$N$"$?$j!";d$N;}$C$F$$$k%P!<%8%g%s$O2?$d$i5sF0$,IT?3$G$9!#(B
sn> tomorrow/yesterday $B$$$:$l$b#1J,@h!"$_$?$$$J46$8$G$9!#8E$9$.$k$N$+$7$i!#(B

$B$3$s$J46$8$G$I$&$G$7$g$&!#(B


--- lib/getdate.y.origSun Jan 19 05:15:18 1997
+++ lib/getdate.yTue Jul 27 19:39:45 1999
@@ -347,7 +347,7 @@
     yyRelYear += $1 * $2;
 }
 | tYEAR_UNIT {
-    yyRelYear++;
+    yyRelYear += $1;
 }
 | tUNUMBER tMONTH_UNIT {
     yyRelMonth += $1 * $2;
@@ -356,7 +356,7 @@
     yyRelMonth += $1 * $2;
 }
 | tMONTH_UNIT {
-    yyRelMonth++;
+    yyRelMonth += $1;
 }
 | tUNUMBER tDAY_UNIT {
     yyRelDay += $1 * $2;
@@ -365,7 +365,7 @@
     yyRelDay += $1 * $2;
 }
 | tDAY_UNIT {
-    yyRelDay++;
+    yyRelDay += $1;
 }
 | tUNUMBER tHOUR_UNIT {
     yyRelHour += $1 * $2;
@@ -374,7 +374,7 @@
     yyRelHour += $1 * $2;
 }
 | tHOUR_UNIT {
-    yyRelHour++;
+    yyRelHour += $1;
 }
 | tUNUMBER tMINUTE_UNIT {
     yyRelMinutes += $1 * $2;
@@ -383,7 +383,7 @@
     yyRelMinutes += $1 * $2;
 }
 | tMINUTE_UNIT {
-    yyRelMinutes++;
+    yyRelMinutes += $1;
 }
 | tUNUMBER tSEC_UNIT {
     yyRelSeconds += $1 * $2;
@@ -392,7 +392,7 @@
     yyRelSeconds += $1 * $2;
 }
 | tSEC_UNIT {
-    yyRelSeconds++;
+    yyRelSeconds += $1;
 }
 ;
 
@@ -487,10 +487,10 @@
 
 /* Assorted relative-time words. */
 static TABLE const OtherTable[] = {
-    { "tomorrow",tMINUTE_UNIT,1 * 24 * 60 },
-    { "yesterday",tMINUTE_UNIT,-1 * 24 * 60 },
-    { "today",tMINUTE_UNIT,0 },
-    { "now",tMINUTE_UNIT,0 },
+    { "tomorrow",tDAY_UNIT,1 },
+    { "yesterday",tDAY_UNIT,-1 },
+    { "today",tDAY_UNIT,0 },
+    { "now",tDAY_UNIT,0 },
     { "last",tUNUMBER,-1 },
     { "this",tMINUTE_UNIT,0 },
     { "next",tUNUMBER,2 },


>$B;d$N(B ctime.c $B$N$h$&$J!"(Btime_t $B7A<0$+$i(B ctime $B7A<0$X$NJQ49$b=PMh$=$&$J(B
>$B5$$,$7$^$9$,!"$3$l$O$I$&$d$C$F$d$k$s$@$m$&!D!#(B

$B$3$s$J$N$O$I$&$G$7$g$&!#(B

gdate --date "1970-01-01 UTC `gdate +%s` sec"

$B$U$J$P(B $B$?$@$h$7(B
