Cortel Cosmin
Posts: 0
Joined: Sat Jan 05, 2013 3:22 pm

rss - modifying the pubDate format in my zone time format

I am developing an rss app and I face following problem:

  • pubDate - is in a wrong time format and i need to change that format. I need to show date and time in my zone. How can be achieve this?
maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

rss - modifying the pubDate format in my zone time format

JavaScript, in mapping.

Riaan Bezuidenhout
Posts: 0
Joined: Tue Feb 19, 2013 9:33 am

rss - modifying the pubDate format in my zone time format

Hi I am a newbie to Java script

Could you supply a sample script

Many Thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

rss - modifying the pubDate format in my zone time format

Hi!

Here is the sample code you can try:codealert('Hello world');/code
Find more here:
http://cs.brown.edu/courses/bridge/19...

Riaan Bezuidenhout
Posts: 0
Joined: Tue Feb 19, 2013 9:33 am

rss - modifying the pubDate format in my zone time format

Thanks for the info

I was looking for a sample script how to parse date format for rss , but came right

var Helpers = {
parsepubDate: function(value) {
var date = new Date(value);
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

Code: Select all

     return date.getDate() + " " + months[date.getMonth()]+ " " + date.getFullYear(); 

 } 

};

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

rss - modifying the pubDate format in my zone time format

If you want to change TimeZone for any Mapping parameter you would need to add JavaScript in mapping:

codevar pubDate = new Date(value);
var offset = -9;

//Convert date to UTC
var utc = pubDate.getTime() + (pubDate.getTimezoneOffset() * 60000);

// create new Date object for different city
// using supplied offset
newDate = new Date(utc + (3600000*offset));

// return time as a string
return newDate().toString();/code
Change offset = -9 to time zone value that you need.

This might be helpful: http://www.webdevelopersnotes.com/tip...

Riaan Bezuidenhout
Posts: 0
Joined: Tue Feb 19, 2013 9:33 am

rss - modifying the pubDate format in my zone time format

Thanx will give that a try

Abhijeet Singh
Posts: 0
Joined: Thu May 08, 2014 5:54 pm

rss - modifying the pubDate format in my zone time format

you conducted a webinar on database services, i created the same, but the problem is want it in the dd/mm/yyy hh:mm AM/PM format and +5:30 time zone. I'dont know java so, could you please give me an exact script that'll work in the mapping 'edit js' ?

Return to “Issues”