Offset Start date and End Date

Hello all. I want to know how ****offset start and end date are calculated in IEM?And also p,d,t,h what does these mean?

The PDTH is specifying an offset in days and time. So P34DT8H7M is 34 days, 8 hours and 7 mins.

Some more in this post
And this post

1 Like

Thanks Gearoid. Could you please tell me what does ‘P’ means here?

And also if i need to do patching based on month , then what should be the offset start and end date?

The P is the duration designator (for period) placed at the start of the duration representation.

This is based on the ISO 8601 standards. [link.](https://en.wikipedia.org/wiki/ISO_8601#Durations)

Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S or
P[n]W as shown to the right. In these representations, the [n] is
replaced by the value for each of the date and time elements that follow
the [n]. Leading zeros are not required, but the maximum number of
digits for each element should be agreed to by the communicating
parties. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.
P is the duration designator (for period) placed at the start of the duration representation.Y is the year designator that follows the value for the number of years.M is the month designator that follows the value for the number of months.W is the week designator that follows the value for the number of weeks.D is the day designator that follows the value for the number of days.T is the time designator that precedes the time components of the representation.H is the hour designator that follows the value for the number of hours.M is the minute designator that follows the value for the number of minutes.S is the second designator that follows the value for the number of seconds.
For example, “P3Y6M4DT12H30M5S” represents a duration of "three
years, six months, four days, twelve hours, thirty minutes, and five
Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W as shown to the right. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required, but the maximum number of digits for each element should be agreed to by the communicating parties. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.

P is the duration designator (for period) placed at the start of the duration representation.
Y is the year designator that follows the value for the number of years.
M is the month designator that follows the value for the number of months.
W is the week designator that follows the value for the number of weeks.
D is the day designator that follows the value for the number of days.
T is the time designator that precedes the time components of the representation.
H is the hour designator that follows the value for the number of hours.
M is the minute designator that follows the value for the number of minutes.
S is the second designator that follows the value for the number of seconds.

For example, “P3Y6M4DT12H30M5S” represents a duration of “three years, six months, four days, twelve hours, thirty minutes, and five seconds”.

So… if you need to do patching on the first of the month… the value you would use for the duration would be

NOW-[StartDate]… which would be represented like this… PXXDTYYHZM

As an example:
NOW = Wed, 06 Jul 2016 11:59:21 -0400
Desired Patch Start Time = Mon, 01 Aug 2016 01:00:00 -0400
NOW-[Desired Patch Start Time] = P24DT13H1M39S

You could potentially use normal relevance to constrain the action start time instead of using the start date offset. This would allow you to better control the start based upon a particular day or hour consistently.

Thanks a lot Jgo and Jgstew.
But when i use BESImport Utility , it is giving the below error

BESAPI.XMLImporter.ImportFile error: XML parsing
error: value ‘P8W4D2T02H04M’ does not match regular expression facet ‘-?P([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(.[0-9]{1,6})?S)?)?’

Please help me on this.

From that error I’d take it that W is not supported, and that you can only use D,T,H,M & S.

Thanks Gearoid. Is there any configuration file , from where i can change the regex pattern?

Can you let us know exactly what you need to do ?
Then we may be able to suggest how you achieve that.

We have to do the patching based on weekly basis and it is automated through an Automation tool .And when i try to pass the week , it is giving the regex pattern issue. And if i want to reconfigure the default regex , from where i can do that?

xyz22223,tst,week1,Sunday_2_00_AM,Reboot,2016p6patchgroups

Can you elaborate on what you mean by weekly basis ?

The offset is a duration - so if you put in a value for 1W for example that means a duration of 7 Days, it doesn’t mean the 1st week of the month.

If you need to do something like: 02.00 Sunday of the 1st week of the month then a duration may not be the way to achieve it.