Skip to content

Instantly share code, notes, and snippets.

@KarlHerler
Created January 14, 2012 16:19
Show Gist options
  • Save KarlHerler/1611929 to your computer and use it in GitHub Desktop.
Save KarlHerler/1611929 to your computer and use it in GitHub Desktop.
Relevant parts of a cache expiry timer
import java.util.Calendar
import java.util.GregorianCalendar
val d = new GregorianCalendar(TimeZone.getTimeZone("Europe/Helsinki"))
d.set(Calendar.HOUR, 10)
val expiry = ((d.getTimeInMillis-System.currentTimeMillis)/1000L).toInt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment