# Table Date Time Conditions Formats

Table Date Time Conditions Formats on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML)

Stars**1025**

Forks**115**

Open issues**0**

PowerShell Gallery downloads**7576901**

Release**v1.45.0**

Language: PowerShell Updated: 2026-11-19

Curated Examples

An example script from the PSWriteHTML repository.

- Source repository: [https://github.com/EvotecIT/PSWriteHTML](https://github.com/EvotecIT/PSWriteHTML)
- Example group: `Example-Table`

```powershell
Import-Module .\PSWriteHTML.psd1 -Force

# Demonstrates date comparisons with formats commonly used in PowerShell/.NET output,
# and verifies both HTML and JavaScript DataStore modes.

$DateDeleteCheck = Get-Date -Year 2025 -Month 1 -Day 5 -Hour 0 -Minute 0 -Second 0

$AdminsDisabled = @(
    [pscustomobject]@{ User = 'Before threshold'; RefreshTokenDate = $DateDeleteCheck.AddDays(-1) }
    [pscustomobject]@{ User = 'Equal to threshold'; RefreshTokenDate = $DateDeleteCheck }
    [pscustomobject]@{ User = 'After threshold'; RefreshTokenDate = $DateDeleteCheck.AddDays(1) }
    [pscustomobject]@{ User = 'Empty / null'; RefreshTokenDate = $null }
)

New-HTML {
    New-HTMLSection -HeaderText 'HTML DataStore (dd/MM/yyyy)' {
        New-HTMLTableOption -DataStore HTML -DateTimeFormat 'dd/MM/yyyy HH:mm:ss'
        New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' {
            New-HTMLTableHeader -Title 'HTML: Highlight RefreshTokenDate < threshold'
            New-HTMLTableCondition -Name 'RefreshTokenDate' -ComparisonType 'date' -Operator lt -Value $DateDeleteCheck -BackgroundColor Red -Color Black -FailBackgroundColor LightGreen -FailColor Black -DateTimeFormat 'dd/MM/YYYY HH:mm:ss'
        }
    }

    New-HTMLSection -HeaderText 'JavaScript DataStore (dd/MM/yyyy)' {
        New-HTMLTableOption -DataStore JavaScript -DateTimeFormat 'dd/MM/yyyy HH:mm:ss'
        New-HTMLTable -DataTable $AdminsDisabled -HideFooter -DisablePaging -DateTimeSortingFormat 'DD/MM/YYYY HH:mm:ss' {
            New-HTMLTableHeader -Title 'JavaScript: Highlight RefreshTokenDate < threshold'
            New-HTMLTableCondition -Name 'RefreshTokenDate' -ComparisonType 'date' -Operator lt -Value $DateDeleteCheck -BackgroundColor Red -Color Black -FailBackgroundColor LightGreen -FailColor Black -DateTimeFormat 'dd/MM/YYYY HH:mm:ss'
        }
    }
} -ShowHTML -FilePath $PSScriptRoot\Example-TableDateTimeConditionsFormats.html -Online
```

<!-- PowerForge markdown artifact sha256:58C1E187BD935D0674ED49E07797DCF7AA4024EF27BB746D6D4C2A3D1AFA7DBB -->
