Hi,
I am retrieving the SMO Database CreateDate property and trying to insert this into a T-SQL DateTime column. The following is a sample of Powershell code to retrieve this property:$serverA.Databases[0].CreateDate The format of the CreateDate returned is "Monday, October 03, 2011 10:31:25 AM" and I would like it to be in this format: "2011-10-03 10:31:25" for inserting into a SQL 2012 table. Is there a function or method that will retrieve the CreateDate in this format?
Thanks for all your help.
Gary
Gary