is this possible to assign a value to TimeSpan?
<p>I have to thank for the early help to advise the "Tick". Now am pretty much got in to my logic except one thing, i have a unix time in my database ,when i was trying to convert to real time and do the logic.</p>

<p>Sorry, let me describe the problem once again,</p>

<p>I have four different timestamp pulled out from DB (Start,End,Start1,End1) converted from unix to real time.  am using the following code to do the conversion</p>

<pre><code>DateTime = Convert.ToDateTime("1/1/1970").AddSeconds(SnapTo5Mins(Convert.ToDouble(UnixDate))).AddHours(GMTOFFset);
</code></pre>

<p>Problem here is,when the value is zero in the coloumn then the date time is returning like (1/1/1970).</p>

<p>for eg. my start value is zero in the database then it retruns (1/1/1970)</p>

<ol>
<li><p>Step 1: compare the timestamp is not equal to 1/1/1970 (origin time)
step 2: if its not equal then do Break = End.Subtract(Start); Step
3: if its equal then assign the break value to zero or whatever step
4: repeat step 1,2,3 for start1 step 5: concatenate both break +
break1</p>

<pre><code>    DateTime Origin = new DateTime(1970, 1, 1, 12, 0, 0, 0);
    DateTime Start ="01/01/1970 12:00";
    DateTime End = 01/01/1970 12:00";
    DateTime Start1 ="02/10/2013 12:20";
    DateTime End1 = "02/10/2013 02:20";
    TimeSpan Break;,finalMealBreak1;
    if (Origin.Year != Start.Year)
    {
        Break = End.Subtract(Start);
    }
    else
    {
        Break = //Assign constant value zero 
    }
      if (Origin.Year != Start1.Year)
    {
        Break1 = End1.Subtract(Start1);//break1 value must be 2hrs
    }
    else
    {
        Break1 = //Assign constant value zero
    }
   TimeSpan FinalBreakResult = Break + Break1; (FinalBreakresult value suppose to be 2 hrs )
</code></pre></li>
</ol>

<p>Thanks in advance</p>
