[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
weird output from date w/ TZ
From: |
Joshua Franklin |
Subject: |
weird output from date w/ TZ |
Date: |
Thu, 1 Nov 2001 09:01:38 -0800 (PST) |
I've searched long and hard on the 'Net and mailing
lists to no avail. There are a lot of webpages with
the word "date" in them, though.
I'm trying to build a script that determined whether
tomorrow is the first of the month, for use in cron.
I've put together something like:
if [ $(TZ=CST-24 date +%e) -eq 1 ]; then
do_stuff
fi
But I'm seeing some weird output from that subshell.
It seems to be off by about 6 hours:
[23:05:03]ns1~$ date
Wed Oct 31 23:05:09 CST 2001
[23:05:09]ns1~$ echo $(TZ=CST-24 date +%D)
11/02/01
[23:05:13]ns1~$ echo $(TZ=CST-18 date +%D)
11/01/01
[23:05:17]ns1~$ echo $(TZ=CST-19 date +%D)
11/02/01
[23:05:57]ns1~$ echo $(TZ=CST date)
Thu Nov 1 05:07:10 CST 2001
[23:05:19]ns1~$ date --v
date (GNU sh-utils) 2.0
Written by David MacKenzie.
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
Anyone have an idea?
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
- weird output from date w/ TZ,
Joshua Franklin <=