Skip to content

Instantly share code, notes, and snippets.

@madsunrise
Created June 26, 2018 12:19
Show Gist options
  • Save madsunrise/178fc89ae6a0502f942caf985ba4d81a to your computer and use it in GitHub Desktop.
Save madsunrise/178fc89ae6a0502f942caf985ba4d81a to your computer and use it in GitHub Desktop.
val cal = Calendar.getInstance()
cal.add(Calendar.HOUR, Random().nextInt(1000) - 500)
cal.add(Calendar.MINUTE, Random().nextInt(120) - 60)
cal.add(Calendar.SECOND, Random().nextInt(120) - 60)
Log.d(TAG, "Setting time: " + SimpleDateFormat("dd-MMM-yyyy HH:mm:ss").format(Date(cal.timeInMillis)) + "...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment