Question: I am on a simulation application and need to attach different time with each record. I am storing the date and time in separate strings:

```
string pdate = DateTime.Now.ToShortDateString();  
string ptime = DateTime.Now.ToShortTimeString();

```

Now I am trying to add 5 minutes to the ptime variable (this I am doing in a foreach loop). 

```
foreach (loaddata dl2 in lstdata)
{
  //some code
  ptime = DateTime.Now.AddMinutes(5); 
  //Results in ptime with date and time(I only need the time here)
}

```

**UPDATE:** I need to add 5 minutes to the previous time in each iteration

Suggestions please.

Answer: 
Why are you storing it in Strings when you can store it in a `DateTime`? `DateTime` is made for dates to be stored, and offers many methods to deal with manipulating date.

If you really need the string, manipulate the `DateTime` and call `ToShortDateString()` afterwards.
Use a `DateTime` object:

```
DateTime current = DateTime.Now;

foreach (loaddata dl2 in lstdata)
{

   //some code
   current = DateTime.Now.AddMinutes(5); 

   string pdate = current.ToShortDateString();  
   string ptime = current.ToShortTimeString();
   // do something with pdate and ptime

   //Results in ptime with date and time(I only need the time here)
}

```