How can I convert ticks to a date format?

前端 未结 4 510
心在旅途
心在旅途 2020-11-27 20:06

I am converting a ticks value to a date like this:

Convert(datetime, (MachineGroups.TimeAdded - 599266080000000000)/864000000000);

Using th

4条回答
  •  [愿得一人]
    2020-11-27 20:38

    A DateTime object can be constructed with a specific value of ticks. Once you have determined the ticks value, you can do the following:

    DateTime myDate = new DateTime(numberOfTicks);
    String test = myDate.ToString("MMMM dd, yyyy");
    

提交回复
热议问题