Como converter DateTime.now.year para dois digitos? Ex: 2021 to 21
Meu code:
Dim ok As String = DateTime.Now.Year.ToString("yy")
shortyear.text = ok
Imprime "yy"
Pronto, consegui resolver o problema da maneira mais facil.
Dim TimeFormat As String = "yy"
Sub Yearget()
yearprint.Text = Convert.ToDateTime(voyagedate.Value).ToString(TimeFormat)
End Sub
Dim ok As String = DateTime.Now.ToString("yy")
veja o exemplo