Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Bug in setDateTimeFormat?

I'd like to update my rss.xml feed to include the 2.0 tag, <pubDate>.

I thought that the following would work:
<pubDate>{$ setDateTimeFormat "English (United States)" "^ddd', 'd MMM yyyy" "hh':'mm':'ss' PST'" $}{$a.filedDate$}</pubDate>

But it doesn't generate the time part.  Is there a way to generate a proper <pubDate> with CityDesk?

David Blume
Tuesday, April 29, 2003

{$ setDateTimeFormat "English (United States)" "^ddd, d MMM yyyy" "hh:mm:ss" $}{$.filedDate$} {$.filedtime$} PST

You need {$a.filedtime$}
Tuesday, April 29, 2003

Here's the output:

Sun, 17 Nov 2002 02:23:46 PST
Tuesday, April 29, 2003

And here's the quick reference. I find it indespensible. I hope Fog puts a link to it in CityDesk. Preferrably in the article edit window in advanced view...
Tuesday, April 29, 2003

Wow!  Fast reply Mark!

But that's not it.  Of course I was using {$a.filedtime$}, the date was correct.  The time was not being printed.

Here's the xml source:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
<rss version="2.0">

<title>Daddy Blog</title>
<description>Anecdotal stories about fatherhood.</description>
<copyright>Copyright 2002-3 David Blume.</copyright>

<title>Daddy Blog</title>
<description>Anecdotal stories about fatherhood.</description>

{$ foreach 10 a in (folder "blog\2002") sortDescendBy .filedDate $}
<title>{$ a.headline $}</title>
<link>{$ $}</link>
{$ a.teaser $}
<pubDate>{$ setDateTimeFormat "English (United States)" "^ddd', 'd MMM yyyy" "HH':'mm':'ss" $}{$a.filedDate$} 11:00:00 PST</pubDate>
{$ next $}


On a Windows XP Home system, you'll see that the fieldDate ignores the time format.  Look at the results at: to see the results of the above script.

Notice that if my script worked as well as yours, then I should get something like

Sun, 17 Nov 2002 02:23:46 11:00:00 PST

Because I hardcode the 11:00:00 into it.

But, because of the bug, it only comes out as:

Sun, 17 Nov 2002 11:00:00 PST

David Blume
Tuesday, April 29, 2003

David, are you saying you inserted "{$.filedDate$} {$.filedTime$}" as Mark suggested? Or did you just use one of the two variables? You don't have both in your code snippet, so I just want to be clear. It'll only work with both.

Darren Collins
Tuesday, April 29, 2003


I think the confusion comes from the fact that you set both the date & time formats in one location, yet when you call them up, you have to use two seperate commands.
Tuesday, April 29, 2003

The scripting quick reference is in the help file in citydesk.  If you are editing an article (or a file) it can be selected from the help menu

Joel Goldstick
Tuesday, April 29, 2003

Joel - I know that. I would like a link *straight* to the reference.
Tuesday, April 29, 2003

Sorry Mark, Darren.
I didn't use both {$.filedDate$} {$.filedTime$} as is evident in the code I pasted.

The other lesson:  Don't think you can do just one easy little site change while your two-year-old is crawling all over you.

Mea culpa.

Other news:  FeedReader still doesn't reflect my <pubDate>  guess I'll try <dc:date> next.

Thanks, everyone!
Tuesday, April 29, 2003

*  Recent Topics

*  Fog Creek Home