Question: I have 2 classes my `Program` class and my `GetDateAndTime` class. I'm getting the time in my `GetDateAndTime` class and I want to pass the time to my main method. I can get the time no problem from my `GetDateAndTime` but when passing the time back to my `program` class I get 00:00:00 instead of 18:00:00. I'm getting my time from my config file.

My code is as follows

Config file

```
<appSettings>
    <add key="StartTime" value="18:00:00" />
</appSettings>

```

**Program Class**

```
private static DateTime t;
static void Main(string[] args)
{
    DateTime day=DateTime.Now;
    GetDateAndTime.CheckDays(day, t);
}

```

**GetDateAndTime Class**

```
public static DateTime CheckDays(DateTime day, DateTime t)
{
    var startTimeString = ConfigurationSettings.AppSettings["StartTime"];
    t = DateTime.Parse(startTimeString);
    t.ToString("HH:mm:ss");
    Console.WriteLine(t.ToString("HH:mm:ss"));
    return day;
}

```

Answer: 
In the call

```
GetDateAndTime.CheckDays(day, t);

```

you are not using the return value. The type `DateTime` is a value type, which cannot be modified in-place, unless the `ref` keyword is used.
> 
> but when passing the time back to my program class
> 
> 
> 

This statement is not represented in your code. You never pass the time back to your program, so your program doesn't know about it.