function (date, type, rule) {
        var offset = 0;

        if (type === 'u' || type === 'g' || type === 'z') { // UTC
          offset = 0;
        } else if (type === 's') { // Standard Time
          offset = basicOffset;
        } else if (type === 'w' || !type) { // Wall Clock Time
          offset = getAdjustedOffset(basicOffset, rule);
        } else {
          throw("unknown type " + type);
        }
        offset *= 60 * 1000; // to millis

        return new Date(date.getTime() + offset);
      }
function (date, type, rule) {
        var offset = 0;

        if (type === 'u' || type === 'g' || type === 'z') { // UTC
          offset = 0;
        } else if (type === 's') { // Standard Time
          offset = basicOffset;
        } else if (type === 'w' || !type) { // Wall Clock Time
          offset = getAdjustedOffset(basicOffset, rule);
        } else {
          throw("unknown type " + type);
        }
        offset *= 60 * 1000; // to millis

        return new Date(date.getTime() + offset);
      }
function ( date , type , rule ) { var offset = 0 ; if ( type === 'u' || type === 'g' || type === 'z' ) { // UTC offset = 0 ; } else if ( type === 's' ) { // Standard Time offset = basicOffset ; } else if ( type === 'w' || ! type ) { // Wall Clock Time offset = getAdjustedOffset ( basicOffset , rule ) ; } else { throw ( "unknown type " + type ) ; } offset *= 60 * 1000 ; // to millis return new Date ( date . getTime ( ) + offset ) ; }
Convert a date to UTC. Depending on the 'type' parameter, the date parameter may be:  - `u`, `g`, `z`: already UTC (no adjustment).  - `s`: standard time (adjust for time zone offset but not for DST)  - `w`: wall clock time (adjust for both time zone and DST offset).  DST adjustment is done using the rule given as third argument.
Convert a date to UTC . Depending on the type parameter the date parameter may be : - u g z : already UTC ( no adjustment ) . - s : standard time ( adjust for time zone offset but not for DST ) - w : wall clock time ( adjust for both time zone and DST offset ) . DST adjustment is done using the rule given as third argument .
Returns the date