# Class Configuration#setCurrentTime

Configuration

- Defined in: configuration.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Configuration#setCurrentTime(successCallback, errorCallback, options) Sets current time.

## Class Detail

Configuration#setCurrentTime(successCallback, errorCallback, options)
Sets current time.

    // Javascript code
    function setCurrentTime () {
      var options = {
         year : 2014,
         month : 1,
         day : 6,
         hour : 14,
         minute : 40,
         sec : 50
      };

      function successCb() {
         // Do something
      }

      function failureCb(cbObject) {
         var errorCode = cbObject.errorCode;
         var errorText = cbObject.errorText;
         console.log ("Error Code [" + errorCode + "]: " + errorText);
      }

      var configuration = new Configuration();
      configuration.setCurrentTime(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object} options

  Property | Type | Description | Required
  --- | --- | --- | ---
  year | Number | year (2000~2037) | required
  month | Number | month (1~12) | required
  day | Number | day (1~31) | required
  hour | Number | hour (0~23) | required
  minute | Number | minute (0~59) | required
  sec | Number | sec (0~59) | required
  ntp | Boolean | NTP(Network Time Protocol) is enabled. If ntp is enabled, other setting values are ignored. true : enabled / false : disabled (default) | optional

Since:
  1.0, 1.3 options.ntp
Returns:

  If the method is successfully executed, success callback function is called without a parameter. If an error occurs, failure callback function is called with a failure callback object as a parameter.

See:
  Configuration.getCurrentTime()