summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-14 01:15:14 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-14 01:15:14 +0000
commitd23723a3e4127763867e72cf6d08084afd5e8146 (patch)
tree6ef4da01378dcea2c3698041c0e0241ed37a5b17
parent63bd99aec2cfc75ac9a4ec22f6f5fe46c7bdf15c (diff)
downloadsamba-d23723a3e4127763867e72cf6d08084afd5e8146.tar.gz
samba-d23723a3e4127763867e72cf6d08084afd5e8146.tar.bz2
samba-d23723a3e4127763867e72cf6d08084afd5e8146.zip
don't use -u switch to /bin/date - too many systems don't honor it
(This used to be commit 0839cf03a92673b38f1afa103271c708fa7162a2)
-rw-r--r--source3/utils/net_time.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index 20d51e2a41..dea1bcd677 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -73,13 +73,13 @@ static time_t nettime(int *zone)
return cli_servertime(opt_host, opt_have_ip? &opt_dest_ip : NULL, zone);
}
-/* return a time as a string ready to be passed to date -u */
+/* return a time as a string ready to be passed to /bin/date */
static char *systime(time_t t)
{
static char s[100];
struct tm *tm;
- tm = gmtime(&t);
+ tm = localtime(&t);
snprintf(s, sizeof(s), "%02d%02d%02d%02d%04d.%02d",
tm->tm_mon+1, tm->tm_mday, tm->tm_hour,
@@ -92,7 +92,7 @@ int net_time_usage(int argc, const char **argv)
d_printf(
"net time\n\tdisplays time on a server\n\n"\
"net time system\n\tdisplays time on a server in a format ready for /bin/date\n\n"\
-"net time set\n\truns /bin/date -u with the time from the server\n\n"\
+"net time set\n\truns /bin/date with the time from the server\n\n"\
"net time zone\n\tdisplays the timezone in hours from GMT on the remote computer\n\n"\
"\n");
general_rap_usage(argc, argv);
@@ -110,7 +110,7 @@ static int net_time_set(int argc, const char **argv)
/* yes, I know this is cheesy. Use "net time system" if you want to
roll your own. I'm putting this in as it works on a large number
of systems and the user has a choice in whether its used or not */
- asprintf(&cmd, "/bin/date -u %s", systime(t));
+ asprintf(&cmd, "/bin/date %s", systime(t));
system(cmd);
free(cmd);