Skip to main content

Query Server Time

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

Call Information

ServerTime(PlayNANOODelegate callback) {}

Call Information 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");
}
});
}
}

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