Solved

VB.Net convert from ToShortDateString to MM/DD/YY in a text box (string)

Posted on 2006-07-18
1
2,270 Views
Last Modified: 2008-02-01
I have a series of column headers that currently are textbox to display date ranges.
 
I have this close to what I want, but would like to trim down 2006 to 06.

Currently displays:
7/18/2006

Would like:
7/18/06

Current code is:

txtDate1.Text = Date.Today.ToShortDateString

Tried format on the end and played around with it but couldn't get this.  Do I need to create a Date Variable, do the formatting, then send to string and set the text box value to this or can I do directly within string like I'm attempting?

Thanks,
Jon

0
Comment
Question by:JMO9966
[X]
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
1 Comment
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 125 total points
ID: 17135028
You could use the ToString method and specify a format in the actual parameter:

txtDate1.Text = Date.Today.ToString("MM/dd/yy")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UDP Data Capture Thread Issue 7 44
Excel Web Add-in Where is Visual Basic used 9 84
Updating Printer Details in VB.Net 16 43
Subtract dates in vb.net 6 35
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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