Solved

RSS formatting pubDate element value

Posted on 2009-05-10
4
881 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

734 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