GridView format data DataFormatString

Source: Internet
Author: User

Set the DataFormatString of BoundField. Generally, the following types of DataFormatString = "{0: C}" currencies are available. The format of the currencies depends on the settings of the Culture in the current Thread. DataFormatString = "{0: e} "scientific notation DataFormatString =" {0: P} "percentage DataFormatString =" {0: F ?} "The digits after the decimal point DataFormatString =" {0: d} "M/d/yyyy such as 10/30/2008 DataFormatString =" {0: f} "long date, short time. Dddd, MMMM dd, yyyy HH: mm aa such as, Monday, January30, 2008 am DataFormatString = "{0: D}" long date. Dddd, MMMM dd, yyyy such as: Monday, January 30,2008 DataFormatString = "{0: F}" long date, long time dddd, MMMM dd, yyyy HH: mm: ss aa DataFormatString = "{0: s}" ISO Standard Time. Yyyy-MM-ddTHH: mm: ss, for example: 2008-01-30T10: 20: 55am DataFormatString = "{0: M}" month and date MMMM dd, such as January30 DataFormatString = "{0: g} "General Format: M/d/yyyy HH: mm: ss aa ----------------------------------------------------------------- Format String input result" {0: C} "12345.6789 $12,345.68" {0: c} "-12345.6789 ($12,345.68)" {0: D} "12345 12345" {0: D8} "12345 00012345" {0: e} "12345.6789 1234568E + 004" {0: E10} "12345.6789 1.2345678900E + 004" {0: F} "12345.6789 12345.68" {0: F0} "12345.6789 12346" {0: g} "12345.6789 12345.6789" {0: G7} "123456789 1.234568E8" {0: N} "12345.6789 12,345.68" {0: N4} "123456789 123,456,789.0000" Total: {0: c} "12345.6789 Total: $12345.68 common date and time formats: format description output format d simplified Date Format MM/dd/yyyy D detailed Date Format dddd, MMMM dd, yyyy f full format (long date + short time) dddd, MMMM dd, yyyy HH: mm F full date Format (long date + long time) dddd, MMMM dd, yyyy HH: mm: ss g General Format (short date + short time) MM/dd/yyyy HH: mm G General Format (short date + long time) MM/dd/yyyy HH: mm: ss m, M month/day format MMMM dd s moderate Date Format yyyy-MM-dd HH: mm: ss t simplified time format HH: mm T detailed time format HH: mm: ss

 

<% # String. Format ("{0: yyyy-MM-dd}", Eval ("inclutivedate") %>

<% # String. Format ("{0: yyyy-M-d}", DataBinder. Eval (Container. DataItem, "EffectiveDate") %>

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.