Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
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?

edited Dec 22, 2020 7:52AM in Fusion Service 9 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!