반응형
Time 클래스가 deprecated 되어서 현재는 GregorianCalendar 클래스를 사용
val tz = TimeZone.getTimeZone("Asia/Seoul")
val gc = GregorianCalendar(tz)
var year = gc.get(GregorianCalendar.YEAR).toString()
var month = gc.get(GregorianCalendar.MONTH).toString()
var day = gc.get(GregorianCalendar.DATE).toString()
var hour= gc.get(GregorianCalendar.HOUR).toString()
var min = gc.get(GregorianCalendar.MINUTE).toString()
var sec = gc.get(GregorianCalendar.SECOND).toString()
'Android > Kotlin' 카테고리의 다른 글
abstract vs lateinit vs lazy (0) | 2017.11.29 |
---|