英文:
Android - Not able to get microseconds using java.time.Instant
问题
我无法从Android中使用java.time.Instant
(Instant.now()
)获取微秒。
> 我从Android获取的日期时间没有微秒,像是2020-04-10T12:43:40.442Z。
但是当我执行一个独立的Java程序,使用java.time.Instant
(Instant.now()
)
> 我获取带有微秒的日期时间,例如2020-04-10T12:43:40.442179Z。
这个问题似乎与Android Studio中的Java版本有关。请帮助我解决这个问题。
注意:
我已经安装了Android Studio - 3.6.1,并在Android Studio设置中进行了JDK 9(9.0.4)的设置。
英文:
I am unable to get the microseconds using java.time.Instant (Instant.now()) from android.
> I am getting the date time without microseconds like 2020-04-10T12:43:40.442Z from android
But when I execute a independent java program, with the use of java.time.Instant (Instant.now())
> I am getting the date time with microseconds like 2020-04-10T12:43:40.442179Z
It seems the issue is with java versions in android studio. Please help me to fix this issue.
Note:
I have installed Android Studio - 3.6.1 and done the JDK 9(9.0.4) Setup in the Android studio Settings.
专注分享java语言的经验与见解,让所有开发者获益!
评论