You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to split time from date?

Accepted answer
12
Views
10
Comments
edited Dec 22, 2020 7:52AM in B2B Service 10 comments

Content

Hi Team,

I want to fetch the time from creationdate of SR. Creationdate is a datetime type. Below is the example

Creationdate : 2020-12-21 10:04:28.0

I want 10:04 from the date. I have tried using substring function but it is not working.Also tried the below script from the groovy script document but it is not accessible from script and throwing error

//To format a datetime value datetimeVal to display only the hours and minutes in 24-hour format, you can do:
Date dv = datetimeVal as Date
def fmt = new Formatter(adf.context.locale)
def ret = (dv != null) ? fmt.format('%tH:%tM', dv, dv) : null

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!