Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从月份缩写中检索月份编号(例如,Jan、Feb、Mar)。这是我尝试过的:
xdata(i) = DateTime.Parse( filteredData.Columns(i + 23).ColumnName.ToString ).ToString("m")
filtersData是一个DataTable,其列名标记为月份缩写。在这种情况下,检索月份编号的最佳方法是什么?
有点像,
Dim monthNumber = DateTime.ParseExact( "Jan", "MMM", CultureInfo.CurrentCulture).Month
其中,"Jan"是您运行代码的月份的有效缩写。
"Jan"