format localdate java
LocalDate today = LocalDate.now();
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
System.out.println(formattedDate);
format localdate java
LocalDate today = LocalDate.now();
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
System.out.println(formattedDate);
date to string kotlin
//create an extension function on a date class which returns a string
private fun Date.dateToString(format: String): String {
//simple date formatter
val dateFormatter = SimpleDateFormat(format, Locale.getDefault())
//return the formatted date string
return dateFormatter.format(this)
}
//call the extension function on a date object
val timestampt = Date()
val dateString = timestamp.dateToString("hh:mm a E dd-MMM")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us