0

i have textbox that contain string month and year value, example: January 2010

but i want to save it into mysql database with format 201001 --->year and then number of month

how can i convert this string?

sephtian
  • 445
  • 2
  • 11
  • 23

1 Answers1

3

Based from this link, maybe you can try this:

Dim dateval As String = "January 2010"
Dim year As String = dateval.Split(" "C)(1)
Dim month As String = DateTime.ParseExact(dateval.Split(" "C)(0), "MMMM", CultureInfo.CurrentCulture).Month.ToString()

Dim yourdateval As String = String.Concat(year, month)
Community
  • 1
  • 1
iceheaven31
  • 877
  • 1
  • 13
  • 23