Time Date Problem on Sun SPARC SOLARIS (Sivakatirswami)
Sadhunathan Nadesan
sadhu at castandcrew.com
Sun Mar 10 21:38:01 EST 2002
| Date: Sat, 09 Mar 2002 08:37:38 -1000
| Subject: Time Date Problem on Sun SPARC SOLARIS
| From: Sivakatirswami <katir at hindu.org>
| To: Metacard List <metacard at lists.runrev.com>
| Reply-To: metacard at lists.runrev.com
|
| I am running a .mt script as a CGI on a Sun SPARC Solaris that hosts our web
| site in Honolulu.
|
| Problem, my script depends on this function:
|
| "put the date"
|
| returns "March 10, 2002" and Greenwich time (London)
|
| BUT
|
| A shell script on the same machine using UNIX to echo the date returns the
| data in Honolulu "March 9, 2002"
|
| So, the "daily lesson" that is built has tomorrow's date.
|
| The sys admin "blames" metacard...but obviously, the server must have *some*
| setting that MC is accessing. thus: two questions:
|
| 1) how to get MC to return the same, local date and time, that a shell
| script returns on the same UNIX machine.
| 2) what setting on the Solaris is MC accessing that I need to tell the sys
| admin to "fix." (they are overloaded like everyone and didn't bother to
| investigate further... so I need to take the initiative here.
|
| Any ideas?
Swamaji:
Unfortunately a lot of stuff obtains GMT by default (like RCS we use
at work, harummph) and that can be confusing. But even if there were some
environment variable you could set to obtain the time zone you want,
how about a primative solution:
A> You normally run the create the daily lesson script at the same time,
so the date offset will be the same every day, so you could subtract a day,
perhaps in some way more efficient that this:
put the date into foo
convert foo to hours
subtract 24*60*60 from foo
convert foo to long date
put foo
B> you could make a system call to the Unix date function instead of using MC, such
as
set the shellcommand to "/bin/sh"
put "date '+%B %d %Y' --date '1 days ago' | sed 's/ /_/g'" | " into command_string
put shell(command_string)
etc..
using whatever the correct date command on (is it Solaris?
I thought it was Sun OS? ) - they could email you the man page.
Aum Aum
Sadhu
More information about the metacard
mailing list