Skip to content

Commit

Permalink
ConvertTo-DbaDataTable - Fix DbaDateTime issue (#9353)
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed May 17, 2024
1 parent d485883 commit 8360233
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public/ConvertTo-DbaDataTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ function ConvertTo-DbaDataTable {
}
}
$specialType = 'Size'
} elseif ($type -eq 'Dataplat.Dbatools.Utility.DbaDateTime') {
$special = $true
$value = [System.DateTime]$value.DateTime
$type = 'System.DateTime'
$specialType = 'DateTime'
} elseif (-not ($type -in $types)) {
# All types which are not found in the array will be converted into strings.
# In this way we don't ignore it completely and it will be clear in the end why it looks as it does.
Expand Down Expand Up @@ -217,6 +222,9 @@ function ConvertTo-DbaDataTable {
$Value.$TimeSpanType
}
}
'DateTime' {
return [System.DateTime]$Value.DateTime
}
}
}

Expand Down

0 comments on commit 8360233

Please sign in to comment.