formating date values
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
formating date values
I'm working on a script (still) that pulls data from an xml file i've got it working and pushing the data to a file. The problem that I have now is that the date is "June 27, 2007" and I need "6/27/2007". I've tried -f and I get an error of not being able to format the screen. I've you need the exact error i can add that code and re-run. i've also tried to use [datevalue] on the string and i get this error: "make sure that the assembly containing this type is loaded."it seems as though get-date has a lot of features but formating a string doesn't.Thanx in advance.P.S. I do plan on getting a book this weekend.
formating date values
I'm working on a script (still) that pulls data from an xml file i've got it working and pushing the data to a file. The problem that I have now is that the date is "June 27, 2007" and I need "6/27/2007". I've tried -f and I get an error of not being able to format the screen. I've you need the exact error i can add that code and re-run. i've also tried to use [datevalue] on the string and i get this error: "make sure that the assembly containing this type is loaded."it seems as though get-date has a lot of features but formating a string doesn't.Thanx in advance.P.S. I do plan on getting a book this weekend.
formating date values
Define a variable at the beginning$dt=get-date -f yyyy-MM-ddHH:mmThen in your loop:$row.idtime=$dtIs that what you're after?