Method: AEMO::Market::Interval#datetime
- Defined in:
- lib/aemo/market/interval.rb
#datetime(trailing_edge: true) ⇒ Time
All AEMO Data operates in Australian Eastern Standard Time All AEMO Data aggregates to the trailing edge of the period (this makes it difficult to do daily aggregations :( )
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/aemo/market/interval.rb', line 38 def datetime(trailing_edge: true) t = @datetime # If the datetime requested is the trailing edge, offset as per interval requirement unless trailing_edge # This is for dispatch intervals of five minutes if dispatch? t -= 5 * 60 elsif trading? t -= 30 * 60 end end t end |