diff --git a/src/AEMO.MDFF.Tests/NEM12/BasicTest.cs b/src/AEMO.MDFF.Tests/NEM12/BasicTest.cs index 936a106..7f2abeb 100644 --- a/src/AEMO.MDFF.Tests/NEM12/BasicTest.cs +++ b/src/AEMO.MDFF.Tests/NEM12/BasicTest.cs @@ -27,8 +27,9 @@ public async Task Test1() case NMIDataDetailsRecord { NextScheduledReadDate: var nsrd }: _testOutputHelper.WriteLine(nsrd.ToLongDateString()); break; - case IntervalDataRecord { IntervalValues: var ivs }: - _testOutputHelper.WriteLine(ivs.ToString()); + case IntervalDataRecord intervalDataRecord: + _testOutputHelper.WriteLine(intervalDataRecord.IntervalValues.ToString()); + _testOutputHelper.WriteLine(intervalDataRecord.UpdateDateTime.ToLongTimeString()); break; } } diff --git a/src/AEMO.MDFF/NEM12/IntervalDataRecord.cs b/src/AEMO.MDFF/NEM12/IntervalDataRecord.cs index f26b25e..7d86dc7 100644 --- a/src/AEMO.MDFF/NEM12/IntervalDataRecord.cs +++ b/src/AEMO.MDFF/NEM12/IntervalDataRecord.cs @@ -10,6 +10,6 @@ public sealed class IntervalDataRecord : IMdffRecord public string QualityMethod { get; set; } public string ReasonCode { get; set; } public string ReasonDescription { get; set; } - public string UpdateDateTime { get; set; } + public DateTime UpdateDateTime { get; set; } public DateTime MSATSLoadDateTime { get; set; } } \ No newline at end of file diff --git a/src/AEMO.MDFF/NEM12/Nem12Reader.cs b/src/AEMO.MDFF/NEM12/Nem12Reader.cs index fa48571..d95ae0f 100644 --- a/src/AEMO.MDFF/NEM12/Nem12Reader.cs +++ b/src/AEMO.MDFF/NEM12/Nem12Reader.cs @@ -105,10 +105,10 @@ private NMIDataDetailsRecord ParseNMIDataDetailsRecord(CsvDataReader csv) private IntervalDataRecord ParseIntervalDataRecord(CsvDataReader csv, string currentNMI) { - var dateString = csv.GetString(1); - var date = DateOnly.ParseExact(dateString, "yyyyMMdd", CultureInfo.InvariantCulture); + var intervalDate = DateOnly.ParseExact(csv.GetString(1), "yyyyMMdd", CultureInfo.InvariantCulture); int intervalLength = _nmiIntervalLengths[currentNMI]; int expectedIntervals = 1440 / intervalLength; // 1440 minutes in a day + var updateDateTime = DateTime.ParseExact(csv.GetString(2 + expectedIntervals + 3), "yyyyMMddHHmmss", CultureInfo.InvariantCulture); var intervalValues = new List(); for (int i = 2; i < expectedIntervals + 2; i++) @@ -118,8 +118,9 @@ private IntervalDataRecord ParseIntervalDataRecord(CsvDataReader csv, string cur return new IntervalDataRecord { - IntervalDate = date, - IntervalValues = intervalValues + IntervalDate = intervalDate, + IntervalValues = intervalValues, + UpdateDateTime = updateDateTime, }; } } \ No newline at end of file