summaryrefslogtreecommitdiff
path: root/util/iseltime.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/iseltime.c')
-rw-r--r--util/iseltime.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/util/iseltime.c b/util/iseltime.c
index e72c93b..28ec5cc 100644
--- a/util/iseltime.c
+++ b/util/iseltime.c
@@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.94";
+static char * progver = "2.95";
static char * progname = "iseltime";
static char fdebug = 0;
static char fset = 0;
@@ -139,14 +139,15 @@ time_t utc2local(time_t t)
}
#define TIMESTR_SZ 30
-void show_time(time_t etime)
+void show_time(time_t etime, int doutc)
{
char buf[TIMESTR_SZ];
int bufsz = TIMESTR_SZ;
time_t t;
strcpy(buf,"00/00/00 00:00:00");
- t = utc2local(etime);
+ if (doutc) t = utc2local(etime);
+ else t = etime;
strftime(buf,bufsz, "%x %H:%M:%S", gmtime(&t)); /*or "%x %T"*/
printf("%s\n",buf);
return;
@@ -195,7 +196,7 @@ main(int argc, char **argv)
printf("Usage: %s [-sx -NUPRETVF]\n", progname);
printf(" where -s Set SEL time (usually once a day)\n");
printf(" -x show eXtra debug messages\n");
- print_lan_opt_usage();
+ print_lan_opt_usage(0);
exit(1);
}
@@ -220,10 +221,10 @@ main(int argc, char **argv)
exit(1);
}
time(&ltime2);
- printf("Current System time: "); show_time(ltime2);
+ printf("Current System time: "); show_time(ltime2,1);
ltime1 = timebuf[0] + (timebuf[1] << 8) + (timebuf[2] << 16) +
(timebuf[3] << 24);
- printf("Current SEL time: "); show_time(ltime1);
+ printf("Current SEL time: "); show_time(ltime1,0);
// if (fdebug) ltime3 = utc2local(ltime1);
@@ -239,7 +240,7 @@ main(int argc, char **argv)
else {
ltime3 = timebuf[0] + (timebuf[1] << 8) + (timebuf[2] << 16) +
(timebuf[3] << 24);
- printf("New SEL time: "); show_time(ltime3);
+ printf("New SEL time: "); show_time(ltime3,0);
}
}
}