In manufacturing, you often have several shifts and you might want to create a token to easily see data for a particular shift on your dashboard.
Here is a walkthrough:
My script from the video:
DateTime dates = new DateTime;
//Get the start of today at 12:00AM DateTime today = DateTime.Today.Date; //Start today at 8am dates = new DateTime(today.Year, today.Month, today.Day, 8, 0, 0); //End today at 4pm dates = new DateTime(today.Year, today.Month, today.Day, 16, 0, 0); //return date range; return dates;
Other great resources for this topic:
****If you’re interested in the Visual Studio Code application that I use for debugging the C# code, this is a great video to help you get set up.