Java examples for java.time:ZonedDateTime
format ZonedDateTime as ddMMYYYYHHmmss
//package com.java2s; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Main { /**// w w w.j a v a 2s. c o m * @param when The instant * @return The instant formatted as "ddMMYYYYHHmmss" (01092015121011) */ static DateTimeFormatter dateTimeFormatPattern = DateTimeFormatter .ofPattern("ddMMyyyyHHmmss"); public static String formatDate_ddMMYYYYHHmmss(ZonedDateTime now) { return now.format(dateTimeFormatPattern); } }