Solved

RSS formatting pubDate element value

Posted on 2009-05-10
4
868 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
4 Comments
 

Accepted Solution

by:
dmanchikalapudi earned 0 total points
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now