Cmdlet
Set-OfficeExcelDateSystem
Sets the workbook date system (1900 or 1904).
Syntax
Set-OfficeExcelDateSystem
[-DateSystem] <NineteenHundred| NineteenFour>
[-Document <ExcelDocument>]
[-PassThru]
[<CommonParameters>]#Parameter set:
DefaultExamples
Use the 1904 date system
Open-OfficeExcel -Path .\Finance\Legacy-Ledger.xlsx {
ExcelDateSystem 1904
}Switches the workbook to the 1904 date system used by some older Mac workbooks.
Match a partner workbook before copying dates
New-OfficeExcel -Path .\Finance\Consolidated.xlsx {
ExcelDateSystem 1904
Copy-OfficeExcelSheet -Source .\Partners\Ledger-1904.xlsx -Sheet Ledger
}Sets the date system of a new workbook to match a 1904-based partner file before copying its sheets in.
Parameters
- -DateSystem ExcelDateSystem
- Date system to use for Excel date serials.
- Possible values:
NineteenHundred,NineteenFour - -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -PassThru SwitchParameter
- Emits the native result after the operation.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.