Here you can find the source of getFormattedDateString()
public static String getFormattedDateString()
//package com.java2s; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { public static String getFormattedDateString() { LocalDateTime currentTime = LocalDateTime.now(); return currentTime.format(DateTimeFormatter.ISO_LOCAL_DATE); }// w ww . ja v a2 s . c om }