I am getting date in the following format :
Thu Jan 01 1970 21:30:00 GMT +0530(IST)
I want to that time will remain and I can change date to the current date like :
Mon Dec 14 2015 21:30:00 GMT +0530(IST)
Can anybody help me ?
Reading the comments I think I understand what you're trying to achieve. Try this:
var oldDate = new Date("Thu Jan 01 1970 21:30:00 GMT +0530(IST)");
var newDate = new Date();
newDate.setHours(oldDate.getHours());
newDate.setMinutes(oldDate.getMinutes());
newDate.setSeconds(oldDate.getSeconds());
Then newDate should contain the date you desire.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With