?
Solved

RSS formatting pubDate element value

Posted on 2009-05-10
4
Medium Priority
?
895 Views
Last Modified: 2013-11-18
I am trying to format pubDate value in MM/DD/YY format in my Javascript. Can anyone give me pointers ?
document.getElementById("chan").innerHTML ="";
	for (var i=0; i<RSS.items.length; i++)
	{	
 
		var item_title = RSS.items[i].title;
		var item_url = RSS.items[i].link;
		var item_date = RSS.items[i].pubDate;
		
		document.getElementById("chan").innerHTML += "<a href ="+ item_url + " target='_blank'>" + item_title +  "</a> " + item_date + "<br>";
	}

Open in new window

0
Comment
Question by:dmanchikalapudi
1 Comment
 

Accepted Solution

by:
dmanchikalapudi earned 0 total points
ID: 24359446
Thank you. I solved this issue ... if anyone is still looking for an answer ... here it is ... I used DateFormat class to parse the pubDate string to a java Date object.



DateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
Date publishedDate = df.parse(((Item) getChannelItems()[currentIteration]).getPubDate().toString().trim());

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question