0

我有包含字符串月份和年份值的文本框,例如:2010 年 1 月

但我想将其保存到 mysql 数据库中,格式为 201001 ---> 年,然后是月数

我怎样才能转换这个字符串?

4

1 回答 1

3

根据这个链接,也许你可以试试这个:

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)
于 2013-05-22T06:20:28.657 回答