상세 컨텐츠

본문 제목

adobe 액션스크립트 AS UTC를 이용한 각 국가별 시간 구하기

ADOBE/ ActionScript

by AlrepondTech 2014. 10. 21. 14:22

본문

반응형

 

 

 

 

=================================

=================================

=================================

 

 

 

 

 

 

출처:  http://202psj.tistory.com/743

 

 class  아무이름

{

 

                public static const millisecondsPerMinute:int = 1000 * 60; 

public static const millisecondsPerHour:int   = 1000 * 60 * 60; 

public static const millisecondsPerDay:int    = 1000 * 60 * 60 * 24;

 

public static var LANG_KR:String = "LANG_KR"; //한국 

                public static var LANG_CN:String = "LANG_CN"; //중국 

                public static var LANG_JP:String = "LANG_JP"; //일본 

                public static var LANG_EN:String = "LANG_EN"; //영문(미국)

 

                private static var _time:Date = new Date();

 

 

//현재 각국가별 시간

public static function setTime(lang:String):void

{

switch(lang)

{

case LANG_KR:

{

_time.setTime(_time.time+(CSetting.millisecondsPerHour*9)); 

}

break;

case LANG_JP:

{

_time.setTime(_time.time+(CSetting.millisecondsPerHour*9)); 

}

break;

case LANG_CN:

{

_time.setTime(_time.time+(CSetting.millisecondsPerHour*8)); 

}

break;

 

case LANG_EN:

{

_time.setTime(_time.time-(CSetting.millisecondsPerHour*8)); 

}

break;

}

}

 

public static function getTimeY():Number

{

return _time.fullYearUTC;

}

 

public static function getTimeM():Number

{

return _time.monthUTC+1;

}

 

public static function getTimeD():Number

{

return _time.dateUTC;

}

 

public static function getTimeH():Number

{

return _time.hoursUTC;

}

 

}

 

 

 

=================================

=================================

=================================

 

 

반응형


관련글 더보기

댓글 영역