例
Dim dtParse1 As Date = Date.Parse("2012/11/26")
Dim dtParse2 As Date = Date.Parse("2012年11月26日")
Dim dtParse3 As Date = CDate("2012/11/26")
通常の変換では無理だか数値変換をすると可能になるのもある。
例
'実行時にエラーとなる。
Dim dtParse4 As Date = Date.Parse("121126")
'実行時にエラーとならず、2012/11/26と処理される。
Dim dtParse5 As Date = Date.Parse(Format(CInt("121126","00/00/00")))
0 件のコメント:
コメントを投稿