0

Hi

My scenario is I have on text box with date (dd-MM-yyyy). I am using ajax in this text box.

I need this date display into another text box with format yyyyMMdd on click the button

Because the invoice no Need the yyyyMMdd-00001 when the user select the date.

How can do this.

Me.txtSoNo.text=me.txtSODate.text.tostring("yyyyMMdd")

error is

System.FormatException: Input string was not in a correct format.

Pls advice me how to do it

maideen

2
Contributors
1
Reply
11
Views
2 Years
Discussion Span
Last Post by __avd
1

You should have to use System.DateTime type.

Dim newDate = DateTime.ParseExact("20111120", 
                                  "yyyyMMdd",
                 CultureInfo.InvariantCulture)

Me.txtSoNo.text=newDate.ToString("yyyyMMdd")

Edited by __avd

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.