How do I extract the time part of the DateTime field?

You can extract time part of date fields using Groovy.

You can use the following

getAt():

  • ActivityStartDate.getAt(Calendar.HOUR));

  • ActivityStartDate.getAt(Calendar.MINUTE));

  • ActivityStartDate.getAt(Calendar.SECOND));

substring():

  • ActivityEndDate.format("yyyy-MM-dd HH:mm:ss").toString().substring(10,12)

For UserTimeZone value, you can use the following Groovy:

  • def value = ActivityEndDate

  • def user_time_zone = oracle.apps.fnd.applcore.common.ApplSessionUtil.getTimeZone();

  • def dateFormat = 'MM/dd/yyyy hh:mm:ss a'

  • def UTZ_ActivityEndDate = value.format(dateFormat, Time zone.getTimeZone(user_time_zone));