Time zone configuration in Quota policy

Not applicable

Can you let me know how to configure the time zone for quota refresh? I want the refresh to happen at the mentioned <StartTime> AEST/AEDT time zone.

1 9 324
9 REPLIES 9

@Madhuri Sridharan ,

<StartTime> is used to specify when to start the counter in GMT timezone. It's not used for refresh. Refresh depends on your quota Interval & TimeUnit. Can you please explain what do you mean by refresh in AEST/AEDT time zone ? An example will definitely help.

@Anil Sagar. I want the quota counter to be reset every day at 12am AEST/AEDT time zone. So i have kept <Interval>1</Interval> <TimeUnit>day</TimeUnit>. You have mentioned <StartTime> is used to specify when to start the counter in GMT timezone. So should I set it 10/11 hours behind 12am?

Or is there a way to change this default GMT to AEST?

@Madhuri Sridharan ,

By default it's in GMT. Yes, Use relative time in <StartTime> along with interval & time unit to set based on your timezone. That should work.

@Anil Sagar I am told that the value cannot be changed in production (-10 hours / -11 hours). Is there any other solution for this?

@Madhuri Sridharan , You mean for production you would like to have a different value ? What do you mean "I am told that the value cannot be changed in production (-10 hours / -11 hours)"

@Anil Sagar For AEST, i would have to set it to -10 hours with respect to GMT. And during day light saving period AEDT setting would be -11 hours with respect to GMT. Hence I would have to change <StartTime> based on this in production code and deploy. Is there any way of avoiding this?

Unfortunately, <StartTime> doesn't support flow variables reference. But, You can do this having two different quota policies that will execute based on your condition by leveraging the policy conditions & some logic that will determine the AEST or AEDT. Hope it helps. Let us know if any.

@Anil Sagar I am planning to compare the current time with AEST/AEDT time and call appropriate quota policy accordingly. I am trying to use javascript policy to get the system time in GMT and convert it to AEST using below code.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Javascript async="false" continueOnError="false" enabled="true" timeLimit="200" name="Date-Check"> <DisplayName>Date-Check</DisplayName> <Properties/> <IncludeURL>jsc://crypto.js</IncludeURL> <ResourceURL>jsc://Date-Check.js</ResourceURL> </Javascript>

var timeNow = Number(context.getVariable('system.timestamp')); print(timeNow); var aestTimeNow = crypto.dateFormat('YYYY-MM-DD HH:mm:ss.SSS','AEST', timeNow); print(aestTimeNow);

Where do I find "crypto.js" file?

Or is there any other way to implement this condition?