Tags:
create new tag
view all tags

Bug: GMTIME Variable Returns Unwanted GMT Text

The recently added code for AlwaysServerTimeZone breaks the TWikiInstallation directory and any application that uses formatted time based on GMTIME. This is because a hardcoded text "GMT" is now added to the returned text, which produces an illegal topic name with spaces if used to construct a topic name.

Test case

<input type="hidden" value="TWikiInstallation%GMTIME{"$year$mo$day$hour$min$sec"}%" name="topic" />

returns:

TWikiInstallation20040225164532 GMT

It should just return TWikiInstallation, followed by a big number consisting of year, month, etc, down to seconds. It should not append space + "GMT" text.

Environment

TWiki version: Latest TWikiAlphaRelease
TWiki plugins: N/A
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- PeterThoeny - 25 Feb 2004

Follow up

d'oh?

I'm going to commit a quick fix, and then work towards a better fix..

because we don't hardcode to GMT anymore, I think we need to add a $tz to the format string for handleTime

and while i'm at it i think i'll see if it can combine the contents of FormatLocalTime, FormatGmTime and the eventual FormatUserRemoteTime, so that there is only handleTime (and / or) its func equivalent, and then we abstract away theZone from the display bit..

-- SvenDowideit - 25 Feb 2004

Actually, it is OK to add a " GMT" to the default format. However, GMTIME and SERVERTIME should exactly return what is specified, e.g. as in %GMTIME{"This year is $year, today is $day"}%.

A new $tz variable sounds like a sensible enhancement. Related, it would be nice to have a new $date(format) besides the existing $date in FormattedSearch and ToolTipTopicInfoOnWikiWordLinks. For example, $date($year/$mo/$day)

-- PeterThoeny - 25 Feb 2004

there is now only one date formatting function, so you can now do things like 2024-02-13T19:19:46Z and get 2004-02-27T06:23

still needs a correct way of doing timezones (it shows GMT and Local right now) added $wday and $tz format strings

I will look at the search formatting later smile

-- SvenDowideit - 26 Feb 2004

Fix record

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2004-02-26 - SvenDowideit
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.