The following code
var date_format = "%M %j, %Y";
var to_str = scheduler.date.date_to_str(date_format);
var from_str = scheduler.date.str_to_date(date_format);
var dt = new Date(2011, 5, 6);
var dt_str = to_str( dt );
var dt2 = from_str(dt_str);
alert('String is ' + dt_str + ' but str_to_date gives ' + dt2);
displays
String is Jun 6, 2011 but str_to_date gives Thu Jan 06 2011 00:00:00 GMT-0800 (Pacific Standard Time)
So str_to_date is converting a string with June to a date in January.