且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在日期时间列表中获取日期?

更新时间:2023-01-31 18:01:48

请参阅:http://msdn.microsoft.com/en-us/library/system .datetime.date%28v = vs.110%29.aspx [ ^ ]。

-SA


您好,

试试这个

Hello ,
Try this
var list=ListDT.GroupBy(x => x.datecolumn.Date).Distinct().ToList();





谢谢



thanks


引用:

string str =10/6/2014;



string [] getDateArray = str.Split('/ ');

//在getDateArray中你可以获得Date作为数组索引的位置date

string date = getDateArray [0];

string str = "10/6/2014";

string[] getDateArray = str.Split('/');
// in getDateArray you Can Get Date as position of in array index of date
string date = getDateArray[0];