Solved
Date format in aem
How to get current date in this date format "2021-05-19T18:27:16.944+05:30" in Java script or Java?
I checked but all were in this format "2021-06-29T04:37:27.796Z". Can anyone tell me what should be format?
Thank you
How to get current date in this date format "2021-05-19T18:27:16.944+05:30" in Java script or Java?
I checked but all were in this format "2021-06-29T04:37:27.796Z". Can anyone tell me what should be format?
Thank you
Did you try java.time.OffsetDateTime ?
you can refer this code snippet
public static void main(String[] args) {
String strDateTime = "Tue Jun 29 15:37:43 GMT+05:30 2021";
DateTimeFormatter dtfInput = DateTimeFormatter.ofPattern("E MMM d H:m:s O u", Locale.ENGLISH);
OffsetDateTime formatedDate= OffsetDateTime.parse(strDateTime, dtfInput);
System.out.println(formatedDate);
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.