I have the following code:
Me.txtFechaFin.Text = '08/03/2018'
can someone tell me how I can convert it to
Me.txtFechaFin.Text = '2018/03/08'
I have the following code:
Me.txtFechaFin.Text = '08/03/2018'
can someone tell me how I can convert it to
Me.txtFechaFin.Text = '2018/03/08'
If I remember correctly, you can do it with the property Format
.
Try something like this in your code:
Me.txtFechaFin.Text = Format(Me.txt.FechaFin.Text, "yyyy/mm/dd")
Convert it to a DateTime object, and then go back to a text string, like this:
DateTime myDate = DateTime.ParseExact(Me.txtFechaFin.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
Me.txtFechaFin.Text = myDate.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture);