서버 시간 조회
현재 서버시간 정보를 조회 합니다.
모든 서버 시간은 UTC 기준으로 제공 됩니다.
호출 정보
ServerTime(PlayNANOODelegate callback) {}
호출 상세 정보
파라미터 | 설명 | 타입 |
---|---|---|
callback | 통신 결과 | PlayNANOODelegate |
소스 코드
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");
}
});
}
}
통신 결과
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"
}
}
}
통신 결과 상세 정보
데이터키 | 설명 | 타입 |
---|---|---|
timezone | 타임존 정보 | string |
timestamp | 1970년1월1일 0시0분0초 부터 현재까지의 초단위 | string |
ISO_8601_date | ISO 8601 표준 포맷 | string |
date | 기본 날짜 포맷 | string |
year | 년도 (4자리) | string |
month | 월 (0포함 2자리) | string |
day | 일자 (0포함 2자리) | string |
hour | 시간 (0포함 2자리) | string |
minute | 분 (0포함 2자리) | string |
second | 초 (0포함 2자리) | string |