irfantak
asked on
ASP .NET C# Show Only Hourly DateTime values from an Array of 24 hour values.
Asp .net C#. Show only date/time values from a 24 hour period which are 3 hours apart. In the following code, dayArray has 360 date/time values. Each value is 4 minutes apart from the other ones. You can see the output of Response.Write in the following page: www.cameradisplay.com/CondorStats/TempDisplayTime.htm
So how I do I just show DateTime values like starting from the very first DateTime value to the next 1 hour DateTime value, and then the next 1 hour, until the end of all 24 hour values?
-------------------------
string[] dayArray = formatData.ToString().Spli t(new char[] { ',' });//split to create array
for (int i = 0; i < (dayArray.Length - 1); i++)
{
DateTime curTime = Convert.ToDateTime(dayArra y[i]);
DateTime displayTime = curTime.AddHours(3);
Response.Write(curTime + "<BR>");
//will show the ouput as //in www.cameradisplay.com/CondorStats/TempDisplayTime.htm
}
-------------------------- ---------- ---------- ------
So how I do I just show DateTime values like starting from the very first DateTime value to the next 1 hour DateTime value, and then the next 1 hour, until the end of all 24 hour values?
-------------------------
string[] dayArray = formatData.ToString().Spli
for (int i = 0; i < (dayArray.Length - 1); i++)
{
DateTime curTime = Convert.ToDateTime(dayArra
DateTime displayTime = curTime.AddHours(3);
Response.Write(curTime + "<BR>");
//will show the ouput as //in www.cameradisplay.com/CondorStats/TempDisplayTime.htm
}
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
http://www.cameradisplay.com/CondorStats/CondorMachineStats.aspx?period=Day&chartenv=sl
and the code is
string[] dayArray = formatData.ToString().Spli
for (int i = 0; i < (dayArray.Length - 1); i++)//because of the extra , at the end, loop to one less
{
DateTime curTime = Convert.ToDateTime(dayArra
Response.Write(curTime + "<br>");
}