Suppose a user of your website enters a date range.
2009-1-1 to 2009-1-3
2009-1-1T8:00:00 to 2009-1-4T7:59:59
The format you need is created with the
.toISOString() method. For older browsers (ie8 and under), which don't natively support this method, the shim can be found here:
This will give you the ability to do what you need:
var isoDate = new Date('yourdatehere').toISOString();