Hausa VBScript FormatDateTime fanna

kaidowar da amfani

Hausa FormatDateTime fanna zai shirya da kuma gudanar da fariyarin wata ko lokaci ko wata.

kalami

FormatDateTime(date,format)
muhammadin Value
date dabara. Kowane fariyarin da kaiwa shida. (Misali Date() ko Now())
format format

Optional. Specifies the format value of the date/time format used.

format parameter: Constant Value
Description vbGeneralDate 0
Display date and/or time. If there is a date part, display it in short date format. If there is a time part, display it in long time format. If both exist, display all parts. vbLongDate 1
Display date using the long date format specified in the computer regional settings. vbShortDate 2
Display date using the short date format specified in the computer regional settings. vbLongTime 3
Display time using this format: hh:mm:ss PM/AM vbShortTime 4

Display time using 24-hour format (hh:mm).

Instance

D = #2001/2/22#
Example 1

Output:

2001-2-22

Example 2

D = #2001/2/22#
document.write(FormatDateTime(D,1))

Output:

February 22, 2001

Example 3

D = #2001/2/22#
document.write(FormatDateTime(D,2))

Output:

2001-2-22

Example 4

D = #2001/2/22#
document.write(FormatDateTime(D,3))

Output:

2001-2-22