Solved

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

Posted on 2006-07-18
1
2,330 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

627 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