Add tags

Add tags to the following comment

SimpleDateFormatは #6498 で使われていたので、 String$format を使ってみました。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import java.util.Date;

public class Sample184 {
    public static String convert(Date date) {
        return String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS.%1$tL", date);
    }

    public static void main(String[] args) {
        System.out.println(convert(new Date()));
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...