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.
月の省略形(1月、2月、3月など)から月番号を取得しようとしています。これが私が試したことです:
xdata(i) = DateTime.Parse( filteredData.Columns(i + 23).ColumnName.ToString ).ToString("m")
FilteredDataは、月の省略形でラベル付けされた列名を持つDataTableです。この場合、月番号を取得するための最良の方法は何ですか?
のようなもの、
Dim monthNumber = DateTime.ParseExact( "Jan", "MMM", CultureInfo.CurrentCulture).Month
は、"Jan"コードを実行する月の有効な省略形です。
"Jan"