相当于noda中的joda LocalTime getMillisOfDay() [英] Equivalent of joda LocalTime getMillisOfDay() in noda

查看:117
本文介绍了相当于noda中的joda LocalTime getMillisOfDay()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些代码从Java移植到.NET,并寻找与LocalTime对象的getMillisOfDay() joda-time方法等效的noda-time.

I am porting some code from Java to .NET and looking for a noda-time equivalent of the getMillisOfDay() joda-time method of the LocalTime object.

是否有一个等效的代码,或者我必须编写自己的代码吗?

Is there an equivalent one or must I code my own?

推荐答案

在Noda Time 1.x中,使用

In Noda Time 1.x, use the LocalTime.TickOfDay property, and then just divide it by NodaConstants.TicksPerMillisecond to get milliseconds:

LocalTime localTime = ...;
long millis = localTime.TickOfDay / NodaConstants.TicksPerMillisecond;

这篇关于相当于noda中的joda LocalTime getMillisOfDay()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆