Gets the wrong date

Hi,
This is shiva , I feel something wrong with date format in katalon.

When I try to get the date format in “DD-MM-YY”, Katalon gives 85-03-19.
Please check DD=85

Thanks
Shiva

Where did you get the Date?

Current date:
LocalDate.now()

Current date (formatted):
LocalDate.now().format(DateTimeFormatter.ofPattern("dd-MM-yy"))

DD means day of year, dd is day of month. See documentation:
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

1 Like

mydate = new Date()
println(mydate)
day_= mydate.format(“YYMMDD”)
println(day_)

Please run above code

@shiva_kumar_k

@Marek_Melocik

Thank you.

I am sorry , dd should have used instead of DD

Learned something from you today.

Thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.