DateFormat DateFormat DateFormat DateFormat Enum

定义

指示在调用 FormatDateTime 函数时如何显示日期。Indicates how to display dates when calling the FormatDateTime function.

public enum class DateFormat
public enum DateFormat
type DateFormat = 
Public Enum DateFormat
继承

字段

GeneralDate GeneralDate GeneralDate GeneralDate 0

对于实数,显示日期和时间。For real numbers, displays a date and time. 如果该数字没有小数部分,则只显示日期。If the number has no fractional part, displays only a date. 如果该数字没有整数部分,则只显示时间。If the number has no integer part, displays time only. 日期和时间显示取决于计算机的区域设置。Date and time display is determined by your computer's regional settings. 此成员等效于 Visual Basic 常量 vbGeneralDateThis member is equivalent to the Visual Basic constant vbGeneralDate.

LongDate LongDate LongDate LongDate 1

使用计算机的区域设置中指定的长日期格式显示日期。Displays a date using the long-date format specified in your computer's regional settings. 此成员等效于 Visual Basic 常量 vbLongDateThis member is equivalent to the Visual Basic constant vbLongDate.

LongTime LongTime LongTime LongTime 3

按计算机中区域设置指定的长时间格式显示时间。Displays a time using the long-time format specified in your computer's regional settings. 此成员等效于 Visual Basic 常量 vbLongTimeThis member is equivalent to the Visual Basic constant vbLongTime.

ShortDate ShortDate ShortDate ShortDate 2

使用计算机的区域设置中指定的短日期格式显示日期。Displays a date using the short-date format specified in your computer's regional settings. 此成员等效于 Visual Basic 常量 vbShortDateThis member is equivalent to the Visual Basic constant vbShortDate.

ShortTime ShortTime ShortTime ShortTime 4

按计算机中区域设置指定的短时间格式显示时间。Displays a time using the short-time format specified in your computer's regional settings. 此成员等效于 Visual Basic 常量 vbShortTimeThis member is equivalent to the Visual Basic constant vbShortTime.

注解

当您调用FormatDateTime函数,可以代替实际值在代码中使用以下枚举成员。When you call the FormatDateTime function, you can use the following enumeration members in your code in place of the actual values.

备注

可以通过双击访问计算机的区域设置区域选项图标,位于控制面板You can access your computer's regional settings by double-clicking the Regional Options icon, found in Control Panel.

适用于

另请参阅