ReadServerTime
Method returns the server time in UTC. This is in UNIX millis time format.
For instance 1472138108000 represents 8/25/2016, 11:15:08 AM in GMT-4.
Service | Operation |
---|---|
time | READ |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.TimeService.ReadServerTime(successCallback, failureCallback);
_bc->getTimeService()->readServerTime(this);
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc timeService] readServerTime:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
this; // implements IServerCallback
_bc.getTimeService().readServerTime(this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
_bc.time.readServerTime(result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
ServerResponse result = await _bc.timeService.readServerTime();
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var timeProxy = bridge.getTimeServiceProxy();
var postResult = timeProxy.readServerTime();
if (postResult.status == 200) {
// Success!
}
{
"service": "time",
"operation": "READ",
"data": {}
}
JSON Response
{
"status" : 200,
"data" :
{
"server_time":1472138108000
}
}