Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Powershell Windows.Forms.DateTimePicker - Date only?

Posted on 2014-11-20
2
1,481 Views
Last Modified: 2014-11-20
I am working with a Windows.Forms.DateTimePicker in a Powershell GUI.

I can pick the date and return the value, but the problem is it is returning the time as well.
How can I get it to just be the value of the date (like "11/20/2014" instead of "11/21/2014 11:45:18 AM"?
0
Comment
Question by:garryshape
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 40455840
You could format the value. For example..
$DatePicker.value.ToString("MM/dd/yyyy")
0
 

Author Closing Comment

by:garryshape
ID: 40455906
sweet it works thanks so much
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A procedure for exporting installed hotfix details of remote computers using powershell
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question