Create file name using date and time

后端 未结 5 1814
清酒与你
清酒与你 2020-12-14 00:31

I hope you could help me, I\'m trying to call in the date from another class and looks like \"2011-03-09 06-57-40\", I want to use this to create the file below but everytim

5条回答
  •  执笔经年
    2020-12-14 01:15

    This one probably much easier. Only one line of a code to assign the name of the file as date and time.

    String out = new SimpleDateFormat("yyyy-MM-dd hh-mm-ss'.tsv'").format(new Date());
    

提交回复
热议问题