Join Date and Time to DateTime in C#

后端 未结 8 870
孤城傲影
孤城傲影 2020-12-25 09:46

I am retrieving data from an iSeries where there is a separate date and time fields. I want to join them into a DateTime field in my C# project. I don\'t see a way to add ju

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 10:15

    You could easily construct a TimeSpan from your "time" field.

    Once you have that, just do:

    TimeSpan time = GetTimeFieldData();
    dateField = dateField.Add(time);
    

提交回复
热议问题