I have a quastion. So I get from server a variable with date-time string which looks like this: '31/08/2015 13:24'. How can extract from this string separately date and time?
1 Answer
You could split the string:
var dateTime = '31/08/2015 13:24'.split(" ");
console.log(dateTime[0]); //date
console.log(dateTime[1]); //time
Or use js Date object to get the day, month, year, hours, etc:
var dateTime = new Date('31/08/2015 13:24');
1 Comment
taxicala
No problem. Glad to help :)