| |

VerySource

 Forgot password?
 Register
Search
View: 755|Reply: 2

DataFormatString formatting issues?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-8 06:40:01
| Show all posts |Read mode
I bound the GridView (Asp.net) to a data table with a date field. I want to set the DataFormatString so that he only displays the date part, and the subsequent hours, minutes, and seconds do not need to be displayed. I just tried to change DataFormatString is set to {0: yyyy-mm-dd}, HtmlEncode = false / true will not work. May I ask what kind of effect should I set to achieve? Note: The date format should be: yyyy-mm-dd
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-9 09:27:01
| Show all posts
{0: d}
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-21 16:45:01
| Show all posts
DataFormatString="{0:yyyy-mm-dd}" HtmlEncode="false"
Just tried it
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list