FormatDateTime Function [VBA]

ቀን እና/ወይንም ሰአት አቀራረብ ለ ቀን መግለጫ እና ውጤት እንደ ሀረግ ይመልሳል

warning

This function or constant is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.


አገባብ:


        FormatDateTime (DateExpression as Date [, NamedFormat as Integer])
    

ዋጋ ይመልሳል:

String

ደንቦች:

የ ቀን መግለጫ: የ ቀን መግለጫ አቀራረብ ሊሰናዳ ነው

NamedFormat: An optional vbDateTimeFormat enumeration specifying the format that is to be applied to the date and time expression. If omitted, the value vbGeneralDate is used.

የ ቀን እና ሰአት አቀራረብ (vbDateTimeFormat enumeration)

የ ተሰየመ የማያቋርጥ

ዋጋ

መግለጫ

vbGeneralDate

0

ቀን እና/ወይንም ሰአት ማሳያ እንደ ተገለጸው በ እርስዎ ኮምፒዩተር ስርአት: ባጠቃላይ ቀን ማሰናጃ: ቀን ብቻ ከሆነ: ሰአት አይታይም: ሰአት ብቻ ከሆነ: ቀን አይታይም

vbLongDate

1

ቀን ማሳያ ረጅም የ ቀን አቀራረብ በ መጠቀም የ ተወሰነውን በ እርስዎ ኮምፒዩተር አካባቢ ማሰናጃ

vbShortDate

2

ቀን ማሳያ አጭር የ ቀን አቀራረብ በ መጠቀም የ ተወሰነውን በ እርስዎ ኮምፒዩተር አካባቢ ማሰናጃ

vbLongTime

3

ሰአት ማሳያ እንደ ተወሰነው በ እርስዎ ስርአት የ ረጅም ሰአት ማሰናጃ

vbShortTime

4

ሰአት ማሳያ በ መጠቀም የ 24=ሰአት አቀራረብ (ሰሰ:ደደ)


የ ስህተት ኮዶች:

13 የ ዳታ አይነት አለመስማማት

ለምሳሌ:


        REM  *****  BASIC  *****
        Option VBASupport 1
        Sub DateFormat
         Dim d as Date
         d = ("1958-01-29 00:25")
         msgbox("General date format : " & FormatDateTime(d))
         msgbox("Long date format : " & FormatDateTime(d,vbLongDate))
         msgbox("Short date format : " & FormatDateTime(d,vbShortDate))
         msgbox("Long time format : " & FormatDateTime(d,3))
         msgbox("Short time format : " & FormatDateTime(d,vbShortTime))
        End Sub
    

Please support us!