Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting Date Format in Groovy

Karthic RajhaMar 27 2012 — edited Mar 28 2012
Hi

I have two fields (TravelDate and DepartureDate)
TravelDate data type - TimeStamp (yyyy-mm-dd hh:mm:ss)
Departure data type - TimeStamp (dd/mm/yyyy)

We have a requirement of comparing TravelDate and DepartureDate.
We are trying to compare the dates using groovy. Since groovy we are unable to pass to_date(substr ('2012-03-27 12:00:00',1,10),'dd/MM/yyyy') . It doesn't convert and instead it says substr name not found

Can anyone help to convert yyyy-mm-dd hh:mm:ss to dd/mm/yyyy in groovy ?



Thanks in Advance,
KR
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2012
Added on Mar 27 2012
4 comments
2,130 views