Home > Net > C # two time in a month for differential space, less than a month and do the processing
C # two time in a month for differential space, less than a month and do the processing
Time:09-16
Because when product demand is not clear, will lead to a group of old data imported into the new table, but had some trouble, specific as follows A so A user data, for example, the start time and end time is respectively The 2020-4-16 10:05:23-2020-4-16 8:05:23
I want to send this period data by month as the time unit is divided into several parts, less than one month alone for 1 the data For example, The 2020-4-16 10:05:23-2020-4-16 10:05:23 The 2020-5-16 10:05:23-2020-5-16 10:05:23 The 2020-6-16 10:05:23-2020-6-16 10:05:23 The 2020-7-16 10:05:23-2020-7-16 10:05:23 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Here omit ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, The 2020-11-16 10:05:23-2020-11-16 10:05:23 2020-12-16 10:05:23-2020-12-16 8:05:23 last 1 because they do not meet a month to do this
Excuse me this how to implement, the key is the last article data
CodePudding user response:
According to big though moral emperor supreme instructions, we just put a piece of code, you can read, can't read don't read the query yield return why, what is the meaning of Aggregate, (or large though moral emperor again that we despise, hit the newcomer, doubt new intelligence, let the couple to read)
static void Main (string [] args) {
DateTime start=DateTime. Parse (" the 2020-4-16 10:05:23 "); DateTime end=DateTime. Parse (" the 2021-1-15 8:05:23 ");