summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
author(no author) <(no author)@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-22 15:51:16 +0800
committer(no author) <(no author)@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-22 15:51:16 +0800
commit0cfe7b8112c995d82069bff7e65e0befc034aa2c (patch)
tree3a299ace7eafe10b33622ec269c29010c5fe6145 /mbbsd/stuff.c
parent1ee4665be1f684f7bc1b7d6ba397e85c849f3872 (diff)
downloadpttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar.gz
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar.bz2
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar.lz
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar.xz
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.tar.zst
pttbbs-0cfe7b8112c995d82069bff7e65e0befc034aa2c.zip
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1195 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 9f13b2ef..d8201330 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -337,27 +337,30 @@ belong(char *filelist, char *key)
#ifndef _BBS_UTIL_C_ /* getdata_buf */
time_t
-gettime(int line, time_t dt)
+gettime(int line, time_t dt, char*head)
{
char yn[7];
+ int i;
struct tm *ptime = localtime(&dt), endtime;
memcpy(&endtime, ptime, sizeof(struct tm));
snprintf(yn, sizeof(yn), "%4d", ptime->tm_year + 1900);
+ move(line, 0); prints("%s",head);
+ i=strlen(head);
do {
- getdata_buf(line, 0, "西元年:", yn, 5, LCECHO);
+ getdata_buf(line, i, " 西元年:", yn, 5, LCECHO);
} while ((endtime.tm_year = atoi(yn) - 1900) < 0 || endtime.tm_year > 200);
snprintf(yn, sizeof(yn), "%d", ptime->tm_mon + 1);
do {
- getdata_buf(line, 13, "月:", yn, 3, LCECHO);
+ getdata_buf(line, i+15, "月:", yn, 3, LCECHO);
} while ((endtime.tm_mon = atoi(yn) - 1) < 0 || endtime.tm_mon > 11);
snprintf(yn, sizeof(yn), "%d", ptime->tm_mday);
do {
- getdata_buf(line, 22, "日:", yn, 3, LCECHO);
+ getdata_buf(line, i+24, "日:", yn, 3, LCECHO);
} while ((endtime.tm_mday = atoi(yn)) < 1 || endtime.tm_mday > 31);
snprintf(yn, sizeof(yn), "%d", ptime->tm_hour);
do {
- getdata_buf(line, 31, "時(0-23):", yn, 3, LCECHO);
+ getdata_buf(line, i+33, "時(0-23):", yn, 3, LCECHO);
} while ((endtime.tm_hour = atoi(yn)) < 0 || endtime.tm_hour > 23);
return mktime(&endtime);
}