c# - How can I check if the same Date is already in a List? -


i have list of datetimes (with times , dates) , need mothod unique days out of seperate list
example:

[1.1.2015 12:34]    [1.1.2015 12:34]   [1.1.2015 12:34] [1.2.2015 4:34]     [1.2.2015 2:34]     [1.2.2015 1:34] [1.3.2015 8:34]     [1.3.2015 1:34]     [1.6.2015 2:34]   

needs turned into:

[1.1.2015 0:0]    [1.2.2015 0:0]    [1.3.2015 0:0]    [1.6.2015 0:0] 

how do this?

you can group them on date property , project keys:

var dates = dateandtimes.groupby(x=> x.date)                         .select(x=>x.key).tolist(); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -