본문 바로가기

Programming Language/Java & Scala

현재 Unixtime 가져오기 in 자바

Unixtime으로 현재시간을 가져오고 싶다면 아래와 같이 수행합니다.

System.currentTimeMillis()
Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).

docs.oracle.com/javase/7/docs/api/java/lang/System.html#currentTimeMillis()

 

System (Java Platform SE 7 )

Sets the system property indicated by the specified key. First, if a security manager exists, its SecurityManager.checkPermission method is called with a PropertyPermission(key, "write") permission. This may result in a SecurityException being thrown. If n

docs.oracle.com

 

반응형