src/04-date-tasks.js
/**
 * Returns the angle (in radians) between the hands of an analog clock
 * for the specified Greenwich time.
 * If you have problem with solution please read: https://en.wikipedia.org/wiki/Clock_angle_problem
 *
 * SMALL TIP: convert to radians just once, before return in order to not lost precision
 *
 * @param {date} date
 * @return {number}
 *
 * @example:
 *    Date.UTC(2016,2,5, 0, 0) => 0
 *    Date.UTC(2016,3,5, 3, 0) => Math.PI/2
 *    Date.UTC(2016,3,5,18, 0) => Math.PI
 *    Date.UTC(2016,3,5,21, 0) => Math.PI/2
 */
Returns the angle (in radians) between the hands of an analog clock
for the specified Greenwich time.

SMALL TIP: convert to radians just once, before return in order to not lost precision

@param {date} date
@return {number}


Returns the angle ( in radians ) between the hands of an analog clock for the specified Greenwich time . SMALL TIP : convert to radians just once before return in order to not lost precision @param { date } date @return { number }
function angleBetweenClockHands(d) {
  let res = d;
  const h = Math.floor(res / (1000 * 60 * 60));
  res -= h * (1000 * 60 * 60);
  const m = Math.floor(res / (1000 * 60));
  res -= m * (1000 * 60);
  const s = Math.floor(res / (1000));
  res -= s * (1000);
  return ((Math.abs((h * 30) - (s * 6))) * (Math.PI / 180));
}
function angleBetweenClockHands ( d ) { let res = d ; const h = Math . floor ( res / ( 1000 * 60 * 60 ) ) ; res -= h * ( 1000 * 60 * 60 ) ; const m = Math . floor ( res / ( 1000 * 60 ) ) ; res -= m * ( 1000 * 60 ) ; const s = Math . floor ( res / ( 1000 ) ) ; res -= s * ( 1000 ) ; return ( ( Math . abs ( ( h * 30 ) - ( s * 6 ) ) ) * ( Math . PI / 180 ) ) ; }
Returns the angle (in radians) between the hands of an analog clock
 for the specified Greenwich time.
Returns the angle ( in radians ) between the hands of an analog clock for the specified Greenwich time .
// console.log(h); // console.log(res); // console.log('m', m); // console.log(res); // console.log(s); // let d = Date.parse(date) // console.log(res)