Skip to main content

asHours

A curve function that breaks a single contract into a list of hours contracts, e.g. a day into hours

Syntax

Contracts = asHours(Contract)
Contracts = asHours(Contract, Timezone)

Result

A Contracts object, if a timezone is specified, all the hours will be in the specified timezone.

Example

function hourly(input, timezone)
hourly = Curve(input.ondate)
hourly.timezone = timezone
for pc in input.contracts
hourly.add(asHours(pc, timezone))
next
end