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 





On Tue, 30 Nov 2004 12:03:36 +1100, Sameer Kekade
<[EMAIL PROTECTED]> wrote:
> I suspect it must be treating 30 Nov 2004 as MM/DD/YYYY format
> internally.
> Mike, can you try the same with smaller dates like 3 Nov 2004 ?
> 
> Warm Regards,
> Sameer S. Kekade.
> QUATRO FOUR RETAIL
> "The right connections for your business"
> Tel. direct  +61 2 9370 2775
> Tel. direct  +61 2 9370 1062
> Fax direct  +61 2 9370 1200
> Mobile 0409 156 038, 0411 566 650
> [EMAIL PROTECTED]
> www.quatro.com.au
> 
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew
> Scott
> Sent: Tuesday, 30 November 2004 11:47 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] RE: isDate function not working as I expected ..
> anyone know why?
> 
> Which seems to be fixed in 6.1:-)
> 
> Must be something else in your code that your not telling us mike?
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew
> Scott
> Sent: Tuesday, 30 November 2004 11:19 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] RE: isDate function not working as I expected ..
> anyone know why?
> 
> Mike,
> 
> I ran into this a few years ago, it appears that the IsDate doesn't like
> the gmt+11:00 in the string, I don't know why but you need to remove
> this from the string for it to work.
> 
> Regards,
> Andrew Scott
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike Kear
> Sent: Tuesday, 30 November 2004 10:05 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] isDate function not working as I expected .. anyone
> know why?
> 
> I'm using the function isDate() to determine if a string is a date, and
> if so, format it and output the result. If it's not a date object, then
> do nothing.
> 
> Ok fine.  But when the RSS feed gives it the value "Tue, 30 Nov 2004
> 09:41:00 GMT+11:00" it throws an error.  The actual error is:
> 
> [quote]
> The value "Tue, 30 Nov 2004 09:41:00 GMT+11:00" could not be converted
> to a date. [/quote]
> 
> I thought that if this string couldn't be converted to a date, that's
> precisely what that function is for.    Apparently not.   So what
> exactly IS it for?   And how do I do what i need then?
> 
> Here's the code in question:
> 
> <cfif isdate(newsitem.pubdate.xmltext)>
>  #lcase(timeformat(newsitem.pubdate.xmltext, "h:mmtt"))# </cfif>
> 
> So if the variable isnt a date (looks like one to me but lets not bother
> about that now) why doesnt this just skip over it and move on?
> Why does it throw an error?
> 
>

---
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