A detailed explanation of FormatDateTime function usage in ASP

Source: Internet
Author: User
Tags date format expression locale

FormatDateTime function

Returns an expression that has been formatted as a date or time.

FormatDateTime (date[, NamedFormat])

Parameters

Parameters

Describe

Date

Required. Any valid the dateexpr ession (like date () or Now ())

Required option. The date expression to be formatted. (such as date () or Now ())

Format

Optional. A format value that specifies the Date/time Format to use

Options available. Indicates the value of the date/time format used

Set up

The NamedFormat parameter can have the following values:

Constant

Value

Describe

Vbgeneraldate

0

Display a date in format Mm/dd/yy. If The date parameter is now (), it would also return to the time after the date

Displays the date and/or time. If there is a date part, the section is displayed as a short date format. If there is a time section, the section is displayed in a long time format. If all exist, all parts are displayed.

vbLongDate

1

Display a date using the long date format:weekday, Month day, year

Displays a date using the long date format specified in the computer's regional settings

Vbshortdate

2

Display a date using the short date format:like the default (MM/DD/YY)

Displays a date using the short date format specified in the computer locale. such as the default (month/day/year)

Vblongtime

3

Display a time using the Format:hh:mm:ss pm/am

Displays the time using the time format specified in the computer locale

vbShortTime

4

Display a time using the 24-hour format:hh:mm

Use 24-hour format (HH:MM) to display time



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.