RowNumber
This is a static class that helps convert dates to row numbers and row numbers to dates.
- class ONE.Operations.Spreadsheet.RowNumber
Overview
For the ACO worksheets, there is a row number assigned to each slot. These row numbers all originate from Midnight on January 1, 1900. Example first five row number to date time for each worksheet type:
Daily
1/1/1900 0:00 (Midnight)
1/2/1900 0:00 (Midnight)
1/3/1900 0:00 (Midnight)
1/4/1900 0:00 (Midnight)
1/5/1900 0:00 (Midnight)
Hourly
1/1/1900 0:00 (Midnight)
1/1/1900 1:00
1/1/1900 2:00
1/1/1900 3:00
1/1/1900 4:00
Four Hour
1/1/1900 0:00 (Midnight)
1/1/1900 4:00
1/1/1900 8:00
1/1/1900 12:00
1/1/1900 16:00
15 Minute
1/1/1900 0:00 (Midnight)
1/1/1900 0:15
1/1/1900 0:30
1/1/1900 0:45
1/1/1900 1:00
Methods
GetDateTimeFromRowNumberAndWorksheetType
Gets the Date Time from a row number. The worksheet type is also required because the row number sequence is different for each worksheet type.
- ONE.Operations.Spreadsheet.RowNumber.GetDateTimeFromRowNumberAndWorksheetType(uint rowNumber, EnumWorksheet worksheetType)
- Parameters
rowNumber (uint) – The number of the row. See overview above.
worksheetType (EnumWorksheet) – The type of the worksheet.
- Returns
The row number given the date and worksheet type. Null is returned if there is an error.
- Return type
DateTime?
GetRowNumberFromDateTimeAndWorksheetType
Gets the Date Time from a row number. The worksheet type is also required because the row number sequence is different for each worksheet type.
- ONE.Operations.Spreadsheet.RowNumber.GetRowNumberFromDateTimeAndWorksheetType(DateTime localDateTime, EnumWorksheet worksheetType)
- Parameters
localDateTime (DateTime) – The local Date and time for the operation.
worksheetType (EnumWorksheet) – The type of the worksheet.
- Returns
The row number given the date and worksheet type. Null is returned if there is an error.
- Return type
DateTime?
TimeSpanOfWorksheetType
Gets the Date Time from a row number. The worksheet type is also required because the row number sequence is different for each worksheet type.
- ONE.Operations.Spreadsheet.RowNumber.TimeSpanOfWorksheetType(EnumWorksheet worksheetType)
- Parameters
worksheetType (EnumWorksheet) – The type of the worksheet.
- Returns
The time span of a row, given the worksheet type.
- Return type
TimeSpan
Properties
- ONE.Operations.Spreadsheet.RowNumber.BaseTime
- Returns
The beginning of time for row numbering
- Return type
DateTime