Question: I need to assign `Date` and `Time` values to a `DateTime` variable separately. Is it possible? 

I have a `DateTime` variable named `currentDate`. I need to assign a `Date` value to it from a `DateTime` variable `start`, and the `Time` value from another `DateTime` variable called `outTime`. 

Let's say `start` has `4/2/2018 10:00:00` as the value stored in it. And, `outTime` has `4/4/2018 16:00:00` as the value stored in it. Thus, my `currentDate` value should be `4/2/2018 16:00:00` where you can see that `4/2/2018` came from `start` and `16:00:00` came from `outTime`. 

I am new to this and I was completely unsure if we could even do this or not. 

**Edit - Code Snippet**

This is how I am doing it. However, I am getting an error on `outTime.TimeOfDay` which says: `Cannot implicitly convert type System.TimeSpan to System.DateTime`

```
currentDate = start.Date;
currentDate = outTime.TimeOfDay;

```

Answer: 
How about adding the `TimeOfDay` part to the `Date` part using `DateTime.Add()`?

```
var date = new DateTime(2018, 1, 5, 20, 0, 0);
var time = new DateTime(2018, 3, 2, 15, 0, 0);

DateTime combined = date.Date.Add(time.TimeOfDay);

```

Results in

> 
> 1/5/2018 3:00:00 PM
> 
> 
>
You can use something like

```
DateTime meetingAppt = new DateTime(2018, 4, 4, 16, 0, 0);

```

You can access to hour only writting

```
meetingAppt.Hour;
meetingAppt.Minute;

```

But at the same time create new one and only use to date

```
meetingAppt.Year;
meetingAppt.Month;
meetingAppt.Day;

```

It's help you?