C# convert UTC int to DateTime object
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I don't know why this is so complicated! I have a plugin that is passing in a long int UTC. I need to convert that number into a DateTime to query my database (SQL Server). I don't know why, but I can't find a workable answer from a basic google search. (For extra credit, I need to turn my returned DateTime back into a UTC at the end of the day.) This is embarrassing to have to ask such a basic question! :) 回答1: My guess is it's going to be either milliseconds or seconds since a particular epoch - quite possibly the Unix epoch of January 1st