if you needed to save the current javascript time in a string, what would it look like and could you convert it back to datetime to read javascript?
What I'm trying does not work, given the current xml line Tue Dec 23 12:02:08 EST 2014
var xmlImagePath = $(this).find('pathName').text();
var xmlStartTime = $(this).find('startTime').text();
xmlStartTime = new Date(xmlStartTime);
var fortnightAway = new Date(xmlStartTime);
var numberOfDaysToAdd = 14;
fortnightAway.setDate(fortnightAway.getDate() + numberOfDaysToAdd);
if (fortnightAway < xmlStartTime) {
alert("here");
}
I do not believe that xmlStartTime = new Date(xmlStartTime);sets xmlStartTime for a datetime object.
Also, What is the correct format for storing datetime in xml so that it is easier to test later?
source
share