Tags:
create new tag
, view all tags

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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Ubuntu 7.04
Web server: Apache 2.2.3
Perl version:  
Client OS: Windows XP
Web Browser: Firefox 2.0.04
Categories: Plugins

-- JasonJystad - 04 Aug 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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! smile

-- JasonJystad - 16 Aug 2007

-- JasonJystad - 16 Aug 2007

 
Change status to:
Topic revision: r4 - 2007-08-16 - JasonJystad
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.