C # A code _c# tutorial to get the start and deadline of a day

Source: Internet
Author: User
private static void the start of the day (DateTime, out datetime start time, out datetime cutoff time)
{
var date = which day. Date;
Start Time =convert.todatetime (DateTime.Now.ToString ("Yyyy-mm-dd 00:00:00"));
Cut-off time =convert.todatetime (DateTime.Now.ToString ("Yyyy-mm-dd 23:59:59"));
}
You can do that when you use it.
Copy Code code as follows:

public static list<string> gets a day word group (DateTime which day)
{
DateTime start time;
DateTime cut-off time;
The starting time of the day (which day, out start time, out cut-off time);
Return to get a repeating word group (start time, cutoff time);
}

Do not use to get a repeating word group (DateTime which is the day) is to take into account the possibility of getting the afternoon or a time period of the word group, more accurate!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.