Query Server Time
Queries the current server time information. All server times are provided based on UTC.
Call Information
ServerTime(PlayNANOODelegate callback) {}
Call Details
| Parameter | Description | Type |
|---|---|---|
| callback | Communication result | PlayNANOODelegate |
Source Code
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
plugin.ServerTime((state, message, rawData, dictionary) => {
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log(dictionary["timezone"]);
Debug.Log(dictionary["timestamp"]);
Debug.Log(dictionary["ISO_8601_date"]);
Debug.Log(dictionary["date"]);
Debug.Log(dictionary["year"]);
Debug.Log(dictionary["month"]);
Debug.Log(dictionary["day"]);
Debug.Log(dictionary["hour"]);
Debug.Log(dictionary["minute"]);
Debug.Log(dictionary["second"]);
} else {
Debug.Log("Fail");
}
});
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"code" : 200,
"message" : 0,
"value" : {
{
"timezone" : "String",
"timestamp" : "Integer",
"ISO_8601_date" : "String",
"date" : "String",
"year" : "String",
"month" : "String",
"day" : "String",
"hour" : "String",
"minute" : "String",
"second" : "String"
}
}
}
Response Details
| Data Key | Description | Type |
|---|---|---|
| timezone | Timezone information | string |
| timestamp | Seconds elapsed from January 1, 1970 00:00:00 to the present | string |
| ISO_8601_date | ISO 8601 standard format | string |
| date | Default date format | string |
| year | Year (4 digits) | string |
| month | Month (2 digits with leading zero) | string |
| day | Day (2 digits with leading zero) | string |
| hour | Hour (2 digits with leading zero) | string |
| minute | Minute (2 digits with leading zero) | string |
| second | Second (2 digits with leading zero) | string |