Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Calendar In CE

Hi,

How to set the working duration and working time in the Calendar? I need the duration to be be 8 hours and working hours 9 am to 6 pm.

Thanks & Regards,

Amrita

Former Member
Former Member replied

There's a preferred way of setting the duration

The representation uses the following literals:

  • P = denotes the duration and must precede every duration value

  • nY = the number prefix (n) is the duration in years

  • nM = the number prefix (n) is the duration in months

  • nD = the number prefix (n) is the duration in days

  • T = is the prefix for the time period in hours, minutes, and seconds. Not required if no times are defined

  • nH = the number prefix (n) is the duration in hours

  • nM = the number prefix (n) is the duration in minutes

  • nS = the number prefix (n) is the duration in seconds

As we need 9 hours of working time . Our string representation would be ""P0Y0M0DT9H0M0S"

where 9H shows 9 working hours.

Please use the below line to set duration

CctDuration duration = new CctDuration("P0Y0M0DT9H0M0S");

Regards,

Ashish

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question