Link to home
Start Free TrialLog in
Avatar of Terry Rogers
Terry RogersFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Date / Time format from SQL Row in Powershell Script

I have a script that executes an SQL query and then populates the data into a HTML table, before email it to a set of recipients.

foreach ($row in $DataSet.Tables[0].Rows)
{ 
    $body += "<tr>
        <td>" + $row[1] + "</td>
        <td>" + $row[2] + "</td>
        <td>" + $row[3] + "</td>
        <td>" + $row[9] + "</td>
        <td>" + $row[10] + "</td>
    </tr>"
}

Open in new window


The first column however shows dates like such: 11/28/2016 12:52:10

How do I go about formatting the date so it reads day, month, year, time ?
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Terry Rogers

ASKER

Perfect, thank you!