Date Code

  • Thread starter Thread starter Leon Shaw
  • Start date Start date
L

Leon Shaw

Dim CurrentDate As Date = Format(Today, "MM/dd/yy")

Dim FutureDate As Date = CurrentDate.AddYears(1)

What am I doing wrong?

I want the CurrentDate to read 07/09/03 and FurtureDate to read 07/09/04,
but in the browser it reads 7/09/2003 and 7/09/2004 respectfully.

Do anyone see something wrong? Please help!
 
Hi,

When you enter a value into DataTime object the value will be keep in
the default format. If you want to write it down in specific format,
reformat it :

System.DateTime CurrentDate = System.DateTime.Now ;
System.DateTime FutureDate = CurrentDate.AddYears(1);
string ww = FutureDate.ToShortDateString ();

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
Back
Top