I have this datetime string
Tue, 20 Oct 2015 17:14:47 +0200
I need to return the date portion from this. In other words, get date, month and year from it.
Currently I've done:
pub_date = new Date("Tue, 20 Oct 2015 17:14:47 +0200")
day = pub_date.getDate()
month = pub_date.getMonth()
year = pub_date.getYear()
Only the day gets returned correctly. month and year return the wrong results. What would be more correct?