Skip to content

Instantly share code, notes, and snippets.

@takoikatakotako
Created June 22, 2017 10:23
Show Gist options
  • Select an option

  • Save takoikatakotako/5252b4fc7f3d75ab2db380709e320899 to your computer and use it in GitHub Desktop.

Select an option

Save takoikatakotako/5252b4fc7f3d75ab2db380709e320899 to your computer and use it in GitHub Desktop.
現在の時間の取得
var calendar = Calendar.getInstance()
val year = calendar.get(Calendar.YEAR)
val month = calendar.get(Calendar.MONTH)
val day = calendar.get(Calendar.DAY_OF_MONTH)
val hour = calendar.get(Calendar.HOUR_OF_DAY)
val minute = calendar.get(Calendar.MINUTE)
val second = calendar.get(Calendar.SECOND)
Log.v("time:year",year.toString())
Log.v("time:month",month.toString())
Log.v("time:day",day.toString())
Log.v("time:hour",hour.toString())
Log.v("time:minute",minute.toString())
Log.v("time:second",second.toString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment