Page 1 of 1

rss - modifying the pubDate format in my zone time format

Posted: Sat Jan 05, 2013 10:12 pm
by Cortel Cosmin

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?

rss - modifying the pubDate format in my zone time format

Posted: Sat Jan 05, 2013 10:38 pm
by maxkatz

JavaScript, in mapping.


rss - modifying the pubDate format in my zone time format

Posted: Tue Feb 19, 2013 9:33 am
by Riaan Bezuidenhout

Hi I am a newbie to Java script

Could you supply a sample script

Many Thanks


rss - modifying the pubDate format in my zone time format

Posted: Tue Feb 19, 2013 11:00 am
by Kateryna Grynko

Hi!

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


rss - modifying the pubDate format in my zone time format

Posted: Tue Feb 19, 2013 11:45 am
by Riaan Bezuidenhout

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(); 

 } 

};


rss - modifying the pubDate format in my zone time format

Posted: Tue Feb 19, 2013 1:27 pm
by Kateryna Grynko

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


rss - modifying the pubDate format in my zone time format

Posted: Tue Feb 19, 2013 2:32 pm
by Riaan Bezuidenhout

Thanx will give that a try


rss - modifying the pubDate format in my zone time format

Posted: Thu May 08, 2014 5:54 pm
by Abhijeet Singh

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