Query Server Time
Queries current server time information.
All server times are provided based on UTC.
Call Information
ServerTime(PlayNANOODelegate callback) {}
Call Information 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");
}
});
}
}
Communication Result
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"
}
}
}
Communication Result
Data Key | Description | Type |
---|---|---|
timezone | Timezone information | string |
timestamp | Seconds since January 1, 1970, at 00:00:00 | string |
ISO_8601_date | ISO 8601 standard format | string |
date | Default date format | string |
year | Year (4 digits) | string |
month | Month (2-digit format with leading zero) | string |
day | Day (2-digit format with leading zero) | string |
hour | Hour (2-digit format with leading zero) | string |
minute | Minute (2-digit format with leading zero) | string |
second | Second (2-digit format with leading zero) | string |