IT. Expert System.

VBS

FormatDateTime()


Description

The FormatDateTime() function formats and returns a valid date or time expression.

This function has the form:

FormatDateTime(date,format)
Parameter Description
date (required) Any valid date expression (like Date() or Now())
format Optional. A value that specifies the date/time format to use. Can take the following values:
  • 0 = vbGeneralDate - Default. Returns date: mm/dd/yy and time if specified: hh:mm:ss PM/AM.
  • 1 = vbLongDate - Returns date: weekday, monthname, year
  • 2 = vbShortDate - Returns date: mm/dd/yy
  • 3 = vbLongTime - Returns time: hh:mm:ss PM/AM
  • 4 = vbShortTime - Return time: hh:mm

Examples

The following example shows the basic use of this function:

d = CDate("2010-02-16 13:45")
Msgbox(FormatDateTime(d))
Msgbox(FormatDateTime(d,1))
Msgbox(FormatDateTime(d,2))
Msgbox(FormatDateTime(d,3))
Msgbox(FormatDateTime(d,4))

This produces the following result (each line in a separate pop-up message box):

2/16/2010 1:45:00 PM
Tuesday, February 16, 2010
2/16/2010
1:45:00 PM
13:45

Miscellaneous Information

Supported in Version: 1.0


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 21 / 158661028. Delta: 0.00120 с