Someone give Darryl a prize.   Yep, you got it Darryl.  That fixed it.
 At least until they change the format again.

This code works:

<li><cfif #isdate(parsedatetime(newsitem.pubdate.xmltext))# eq
true>#lcase(timeformat(parsedatetime(newsitem.pubdate.xmltext),
"h:mmtt"))# - </cfif><a href="#newsitem.link.xmltext#"
target="_blank">#newsitem.title.xmltext#</a></li>

The result is as follows: 

12:38pm - 'Breakthrough' on hydrogen fuel 
12:35pm - Retail spending soft in Oct 
12:25pm - Dollar drops on weak data 
12:18pm - Latham, Conroy tension brief airing 
12:12pm - Garrett returns to work 


Thanks Darryl. 

Mystery solved. 


(although I'm still at a loss to understand why the IsDate() function
doesnt return false if the contents dont seem to be a date and throws
an error instead)


Cheers
Mike Kear
Windsor, NSW, Australia
AFP Webworks
http://afpwebworks.com
.com,.net,.org domains from AUD$20/Year




On Tue, 30 Nov 2004 11:48:28 +1000, Darryl Lyons
<[EMAIL PROTECTED]> wrote:
> You sure its not throwing an error on the timeformat() now? There is no
> parsedatetime() around the pubdate
> 
> Darryl
> 
> [EMAIL PROTECTED] wrote on 30/11/2004 11:44:34 AM:
> 
> 
> 
> > It's coming in the date field in a RSS2.0 news feed.   Until this
> > morning it was fine,  then when i checked my site this morning I was
> > getting this error.  So over night the newsfeed must have changed
> > their date format.
> >
> > Anyway, here's the code, after parsing the XML feed:
> >
> > <li><cfif isdate(parsedatetime(newsitem.pubdate.xmltext))>
> > #lcase(timeformat(newsitem.pubdate.xmltext, "h:mmtt"))# -
> > </cfif><a href="#newsitem.link.xmltext#"
> > target="_blank">#newsitem.title.xmltext#</a></li>
> >
> > So if there's a valid date, what displays is the time of day and the
> > headline.   IF the date is not a valid date, it should display only a
> > headline.  But it doesnt.  It throws an error.
> >
> > I dont want to pass the whole date in, because all i want to display
> > is the time of day. the headlines change every few minutes so the top
> > 5 headlines will only be on the site for a couple of hours at most.  I
> > dont need the date there and there' s no room anyway.
> >
> > Sameer, it's worked fine until today, so other date formats must work
> fine.
> >
> > Cheers
> > Mike Kear
> > AFP Webworks
> > Windsor, NSW, Australia
> >
> >

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to