So what I want to do is get new Date():
Wed Oct 02 2013 22:15:00 GMT-0400 (EDT)
And replace the 22:15:00 for something else...
Is that possible using jquery?
You can use a regex and .replace()
'Wed Oct 02 2013 22:15:00 GMT-0400 (EDT)'.replace(/\d\d:\d\d:\d\d/, '00:00:00')
var l = new Date; then l.replace(/\d\d:\d\d:\d\d/, '00:00:00')l.setHours(0); l.setMinutes(0); l.setSeconds(0);I think you need a generic solution. You could go for a regex based solution. But lets keep it simple.
What you have in hand is a Date object right? The Date object supports methods like setHours(), setMinutes() and setSeconds(). Use them to change the time!
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date