function convertLocalDateToUTCDate(date, toUTC) {
  date = new Date(date);
  //Local time converted to UTC
  var localOffset = date.getTimezoneOffset() * 60000;
  var localTime = date.getTime();
  if (toUTC) {
    date = localTime + localOffset;
  } else {
    date = localTime - localOffset;
  }
  newDate = new Date(date);
  return newDate;
}
// Time convert Local -> UTC
Time convert Local -> UTC
Time convert Local - > UTC
function convertLocalDateToUTCDate(date, toUTC) {
  date = new Date(date);
  var localOffset = date.getTimezoneOffset() * 60000;
  var localTime = date.getTime();
  if (toUTC) {
    date = localTime + localOffset;
  } else {
    date = localTime - localOffset;
  }
  newDate = new Date(date);
  return newDate;
}
function convertLocalDateToUTCDate ( date , toUTC ) { date = new Date ( date ) ; var localOffset = date . getTimezoneOffset ( ) * 60000 ; var localTime = date . getTime ( ) ; if ( toUTC ) { date = localTime + localOffset ; } else { date = localTime - localOffset ; } newDate = new Date ( date ) ; return newDate ; }
Time convert Local -> UTC
Time convert Local - > UTC
//Local time converted to UTC