# Set-OfficeExcelDateSystem

Sets the workbook date system (1900 or 1904). Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice Cmdlet Reference.

Cmdlet 

Aliases: ExcelDateSystem

**Module**

`PSWriteOffice`

**Aliases**

`ExcelDateSystem`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelDateSystemCommand.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelDateSystemCommand.cs#L31) 

Sets the workbook date system (1900 or 1904).

## Syntax

```
Set-OfficeExcelDateSystem
[-DateSystem] <NineteenHundred|NineteenFour>
[-Document <ExcelDocument>]
[-PassThru]
[<CommonParameters>]
```

[#](#method-set-officeexceldatesystem-exceldatesystem-exceldocument-switchparameter)

Parameter set: `Default`

## Examples

### Use the 1904 date system

```powershell
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

```powershell
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 requiredposition: 0**

Date system to use for Excel date serials.

Possible values: `NineteenHundred`, `NineteenFour`

**-Document ExcelDocument optionalpipeline: True (ByValue)**

Caller-owned workbook; omission uses the enclosing Excel content block.

**-PassThru SwitchParameter optional**

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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:AD564311B30EDE0F4E65BB826F4D03DD8323479FB968AC5759E1F9C7925BEA57 -->
