Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now