Skip to main content

Query Server Time

Queries the current server time information. All server times are provided based on UTC.

Call Information

ServerTime(PlayNANOODelegate callback) {}

Call Details

ParameterDescriptionType
callbackCommunication resultPlayNANOODelegate

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 KeyDescriptionType
timezoneTimezone informationstring
timestampSeconds elapsed from January 1, 1970 00:00:00 to the presentstring
ISO_8601_dateISO 8601 standard formatstring
dateDefault date formatstring
yearYear (4 digits)string
monthMonth (2 digits with leading zero)string
dayDay (2 digits with leading zero)string
hourHour (2 digits with leading zero)string
minuteMinute (2 digits with leading zero)string
secondSecond (2 digits with leading zero)string