Avatar of Moti Mashiah
Moti Mashiah
Flag for Canada

asked on 

C sharp

Hi Guys,
I'm using the DateTime class and I'm trying to return the last two week with this format:

Nov  1 - 15.

so, I'm doing something like:
List<DateTime> LastMonthFirst2Week = (from i in Enumerable.Range(0, 2) select DateTime.Today.AddDays(-(i * 12))).ToList();

 foreach (var t in LastMonthFirst2Week)
                var tf = new Timeframe();
                tf.LastMonthFirst2Week = t.ToString("MMM d");

Open in new window

by doing what I post above it gives me Nov 1 - so how do I get the end of it.? like the 15

.NET ProgrammingC#

Avatar of undefined
Last Comment
Moti Mashiah

8/22/2022 - Mon