Brian
Brian

Reputation: 622

Formatting time for HH:mm in groovy

I'm having an awful time trying to format 2014-06-02T15:00:00.000-0700 as HH:mm

I have tried def arrivalTimeFormatted = arrivalTime.format("HH:mm") with no luck.

Upvotes: 0

Views: 1783

Answers (1)

dmahapatro
dmahapatro

Reputation: 50245

Date.parse( "yyyy-MM-dd'T'HH:mm:ss.SSSX", '2014-06-02T15:00:00.000-0700' )
    .format( 'HH:mm' )

Is this what you are looking for?

Upvotes: 1

Related Questions