Question
I am trying to figure out a way to format the time display that I get from using the
%LOCALCITYTIME{""}%
variable from the plugin by the same name.
Environment
--
JasonJystad - 04 Aug 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Well I was able to get it to display the format they wanted, almost.
eg: Sun 4:32 PM
What I have so far is this:
%CALC{"$FORMATTIME($TIME(%LOCALCITYTIME{"America/Los_Angeles"}%), $wday $hour:$minute)"}%
Pretty much there, just have to figure out how to convert the display to a 12 hour clock.
--
JasonJystad - 06 Aug 2007
Any ideas, or if I am making this harder than it needs to be, please chime in.
--
JasonJystad - 06 Aug 2007
I extended the above statement with a conditional and got it working in the 12 hour mode they wanted, but now it tosses an error every so often: "ERROR: Illegal octal digit '8', at end of line". Still working on it, so I am still up for help.
--
JasonJystad - 14 Aug 2007
For the record, it may have tossed the error before the conditional. It only happens sometimes.
--
JasonJystad - 14 Aug 2007
Well, I couldn't work this out so I went ahead and just altered the LocalCItyTime.pm file in /var/www/twiki/lib/TWiki/Plugins (I am running Ubuntu) to output the date format I wanted.
I changed the $datparam line to this:
$dateParam = "'+\%a, \%b \%d \%l:%M \%p'";
I also commented out the line that adds the parenthetical link to the full timzone description.
That line looks like this:
$text .= " (<a href=\"$gatewayUrl$gatewayParam$timeZone\">$timeZone</a>)";
This gives me something like this: Sun, Aug 16 4:32 PM
This is a slightly expanded version of what I was going for.
--
JasonJystad - 16 Aug 2007
Oh, and as always back up the file before you make your changes!
--
JasonJystad - 16 Aug 2007
--
JasonJystad - 16 Aug 2007