Created
November 27, 2015 04:54
-
-
Save ShinjiKobayashi/bc96610bf18819e0e94f to your computer and use it in GitHub Desktop.
日付をファイル名にするやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample(){ | |
private val writer: PrintWriter by lazy { | |
val name = SimpleDateFormat("yyyyMMdd_HHmmss'.log'").format(Date(System.currentTimeMillis())) | |
PrintWriter(BufferedWriter(FileWriter(File("${Environment.getExternalStorageDirectory()}/$name")))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment