All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.jwt-core-legacy-impl_2.11.0.7.1.source-code.JwtTimeImpl.scala Maven / Gradle / Ivy

The newest version!
package pdi.jwt

import java.util.{Calendar, TimeZone}

trait JwtTimeImpl {
  val TimeZoneUTC = TimeZone.getTimeZone("UTC")

  /** Returns the number of millis since the 01.01.1970
    *
    * @return Returns the number of millis since the 01.01.1970
    */
  def now: Long = Calendar.getInstance(TimeZoneUTC).getTimeInMillis

  def format(time: Long): String = {
    val cal = Calendar.getInstance(TimeZoneUTC)
    cal.setTimeInMillis(time)
    cal.getTime.toString
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy