| 名前空間一覧 > GrapeCity.Web.Input.IMDate 名前空間 > GcDateTime クラス : DisplayFormat プロパティ |
Public Property DisplayFormat As DateDisplayFormat
public DateDisplayFormat DisplayFormat {get; set;}
| キーワード | 説明 |
|---|---|
| A | 紀元後を表す" A.D.(Anno Domini)"を表示 |
| g | 年号の頭文字をアルファベットで表示(M、T、S、H) |
| gg | 年号の頭文字を漢字で表示(明、大、昭、平) |
| ggg | 年号の正式名称を漢字で表示(明治、大正、昭和、平成) |
| e | 和暦年を2桁で表示(先頭に0を付けない) |
| ee | 和暦年を2桁で表示(先頭に0を付ける) |
| E | 和暦年を2桁で表示し開始年を元と表示(先頭に0を付けない)(例:平成元年) |
| EE | 和暦年を2桁で表示し開始年を元と表示(先頭に0を付ける)(例:平成元年) |
| y | 年を2桁で表示(先頭に0を付けない) |
| yy | 年を2桁で表示(先頭に0を付ける) |
| yyy | 年を4桁で表示(先頭に0を付けない) |
| yyyy | 年を4桁で表示(先頭に0を付ける) |
| M | 月を2桁の数字で表示(先頭に0を付けない) |
| MM | 月を2桁の数字で表示(先頭に0を付ける) |
| MMM | 月を省略形で表示 (DateTimeFormatInfo.AbbreviatedMonthNames() で指定された形式) |
| MMMM | 月を正式名称で表示 (DateTimeFormatInfo.MonthNames()で指定された形式) |
| d | 日を表示(先頭に0を付けない) |
| dd | 日を表示(先頭に0を付ける) |
| ddd | 曜日を省略形で表示 (DateTimeFormatInfo.AbbreviatedDayNames()で指定された形式) |
| dddd | 曜日を正式名称で表示 (DateTimeFormatInfo.DayNames()で指定された形式) |
| \(Chr(92)) | キーワードをリテラル文字として表示 |
以下の時刻に関するキーワードは、日付コントロール(GcDateクラス)ではサポートされません。
| キーワード | 説明 |
|---|---|
| t | 12時間制で時刻を表示するときに午前(AMDesignatorプロパティで設定)または午後(PMDesignatorプロパティで設定)を表す文字列の最初の1文字を表示 |
| tt | 12時間制で時刻を表示するときに午前(AMDesignatorプロパティで設定)または午後(PMDesignatorプロパティで設定)を表す文字列を表示 |
| h | 時を12時間制で表示(先頭に0を付けない) |
| hh | 時を12時間制で表示(先頭に0を付ける) |
| H | 時を24時間制で表示(先頭に0を付けない) |
| HH | 時を24時間制で表示(先頭に0を付ける) |
| m | 分を表示(先頭に0を付けない) |
| mm | 分を表示(先頭に0を付ける) |
| s | 秒を表示(先頭に0を付けない) |
| ss | 秒を表示(先頭に0を付ける) |
| \(Chr(92)) | キーワードをリテラル文字として表示 |
| 書式指定子 | 説明 |
|---|---|
| d | 短い形式の日付 (例:2015/11/01) |
| D | 長い形式の日付 (例:2015年11月1日) |
| t | 短い形式の時刻 (例:10:30) |
| T | 長い形式の時刻 (例:10:30:00) |
| f | 長い形式の日付と短い形式の時刻 (例:2015年11月1日 10:30) |
| F | 長い形式の日付と長い形式の時刻 (例:2015年11月1日10:30:00) |
| g | 短い形式の日付と短い形式の時刻 (例:2015/11/01 10:30) |
| G | 短い形式の日付と長い形式の時刻 (例:2015/11/01 10:30:00) |
| Mまたはm | 月日の表示 (例:11月1日) |
| Rまたはr | RFC1123の形式 (例:Fri, 01 Nov 2015 10:30:00 GMT) |
| S | ISO 8601準拠の形式 (例:2015-11-01T10:30:00) |
| u | ユニバーサル形式 (例:2015-11-01 10:30:00Z) |
| U | 世界協定時刻 (例:2015年11月1日1:30:00) |
| Yまたはy | 年月の表示 (例:2015年11月) |
' 日付の書式を設定します。 GcDateTime1.Format.Pattern = "ggg ee年 MM月 dd日" GcDateTime1.DisplayFormat.Pattern = "ggg ee年 MM月 dd日" ' 時刻の書式を設定します。 GcDateTime1.AMDesignator = "午前" GcDateTime1.PMDesignator = "午後" GcDateTime1.Format.Pattern = "tt hh時 mm分" GcDateTime1.DisplayFormat.Pattern = "tt hh時 mm分"
// 日付の書式を設定します。 GcDateTime1.Format.Pattern = "ggg ee年 MM月 dd日"; GcDateTime1.DisplayFormat.Pattern = "ggg ee年 MM月 dd日"; // 時刻の書式を設定します。 GcDateTime1.AMDesignator = "午前"; GcDateTime1.PMDesignator = "午後"; GcDateTime1.Format.Pattern = "tt hh時 mm分"; GcDateTime1.DisplayFormat.Pattern = "tt hh時 mm分";
Imports GrapeCity.Web.Input.IMDate ' 日付の書式を設定します。 GcDateTime1.Format = New DateFormat("ggg ee年 MM月 dd日") GcDateTime1.DisplayFormat = New DateDisplayFormat("ggg ee年 MM月 dd日") ' 時刻の書式を設定します。 GcDateTime1.AMDesignator = "午前" GcDateTime1.PMDesignator = "午後" GcDateTime1.Format = New DateFormat("tt hh時 mm分") GcDateTime1.DisplayFormat = New DateDisplayFormat("tt hh時 mm分")
using GrapeCity.Web.Input.IMDate; // 日付の書式を設定します。 GcDateTime1.Format = new DateFormat("ggg ee年 MM月 dd日"); GcDateTime1.DisplayFormat = new DateDisplayFormat("ggg ee年 MM月 dd日"); // 時刻の書式を設定します。 GcDateTime1.AMDesignator = "午前"; GcDateTime1.PMDesignator = "午後"; GcDateTime1.Format = new DateFormat("tt hh時 mm分"); GcDateTime1.DisplayFormat = new DateDisplayFormat("tt hh時 mm分");