Join Date and Time to DateTime in C#

后端 未结 8 817
孤城傲影
孤城傲影 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:10

    Note that adding the time to the date is not your biggest problem here. As @Reed Copsey mentioned, you just create a DateTime from the date and then .Add the time.

    However, you need to make sure that the iSeries date and time (a Unix time most probably) are in the same representation as the .Net representation. Thus, you most probably need to convert it by adding it to a Jan 1, 1970 DateTime as well.

提交回复
热议问题