text: 'use strict';
  var moment = require('moment');
  var DateTimeValue = (function () {
      function DateTimeValue(value, offset) {
          this.value = value;
          this.offset = offset;
      }
      DateTimeValue.fromUnixMillisecondTimestamp = function (unixTimeStamp, hrTime) {
          var ns = hrTime[0] * 1e9 + hrTime[1];
          return new DateTimeValue(moment('' + unixTimeStamp, 'x'), ns);
      };
      DateTimeValue.fromMomentAndHRTime = function (m, hrTime) {
          var ns = hrTime[0] * 1e9 + hrTime[1];
          return new DateTimeValue(m, ns);
      };
      DateTimeValue.prototype.diff = function (value) {
          var thisOffset = this.offset;
          var valueOffset = value.offset;
          return (thisOffset - valueOffset) / 1e6;
      };
      DateTimeValue.prototype.getMoment = function () {
          return this.value;
      };
      DateTimeValue.prototype.getOffset = function () {
          return this.offset;
      };
      DateTimeValue.prototype.format = function (includeUTCOffset) {
          if (includeUTCOffset === void 0) { includeUTCOffset = true; }
          // equivalent to this.value.format('YYYY-MM-DDTHH:mm:ss.SSS ZZ') with UTC offset 
          // or this.value.format('YYYY-MM-DDTHH:mm:ss.SSS') without UTC offset  
          var m = this.value;
          var rtrn = m.year() + '-' +
              DateTimeValue.toTwoDigits(m.month() + 1) + '-' +
              DateTimeValue.toTwoDigits(m.date()) + 'T' +
              DateTimeValue.toTwoDigits(m.hour()) + ':' +
              DateTimeValue.toTwoDigits(m.minute()) + ':' +
              DateTimeValue.toTwoDigits(m.second()) + '.' +
              DateTimeValue.toThreeDigits(m.millisecond());
          if (includeUTCOffset) {
              rtrn += this.getUTCOffset(false);
          }
          return rtrn;
      };
      DateTimeValue.prototype.getUTCOffset = function (includeColon) {
          if (includeColon === void 0) { includeColon = true; }
          // equivalent to moment().format('Z') or moment().format('ZZ') (with/without colon respectively).
          var offset = this.value.utcOffset();
          var sign = (offset >= 0) ? '+' : '-';
          offset = Math.abs(offset);
          var hours = DateTimeValue.toTwoDigits(Math.floor(offset / 60));
          var minutes = DateTimeValue.toTwoDigits(offset % 60);
          var rtrn;
          if (includeColon) {
              rtrn = sign + hours + ':' + minutes;
          }
          else {
              rtrn = sign + hours + minutes;
          }
          return rtrn;
      };
      DateTimeValue.toTwoDigits = function (value) {
          return value < 10 ? '0' + value : value;
      };
      DateTimeValue.toThreeDigits = function (value) {
          if (value < 10) {
              return '00' + value;
          }
          if (value < 100) {
              return '0' + value;
          }
          return '' + value;
      };
      return DateTimeValue;
  }());
  exports.DateTimeValue = DateTimeValue;
  
  //# sourceMappingURL=../../maps/configuration/DateTimeValue.js.map
  