掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
年月の取得 (ID:141652)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
読み込んだデータに対して年の最初の2文字を削除し 月が9以下なら"0"を追加してます。 Dim MyDate As String = "2009.9.7" Dim DateArray() As String '読み込んだデータを「.」で区切る DateArray = MyDate.Split(".") '年の最初の2文字削除 Dim Year As String = DateArray(0).Remove(0, 2) Dim intMonth As Integer = DateArray(1) Dim Month As String '月が9以下ならば"0"を追加 If intMonth < 10 Then Month = DateArray(1).Insert(0, "0") Else Month = intMonth End If MsgBox(Year & Month)
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.