简体   繁体   English

具有UTC时间的进度栏

[英]Progress Bar with UTC time

I have a progress bar, I have to set progress in int value, but I have long UTC time 我有一个进度栏,我必须设置int值的进度,但是我的UTC时间long

example: 例:

start = 1474369800000
end = 1474371600000
now = 1474370572206

I'm going crazy in seeking the right proportion for setting the advancement of the progress bar (100 intervals) according to the current time and time from now. 我为根据当前时间和现在的时间来设置进度条的进度(100个间隔)寻求合适的比例而感到疯狂。

Could someone explain to me how to divide the interval correctly ? 有人可以向我解释如何正确划分间隔吗?

if I understand problem i think it is: 如果我了解问题,我认为是:

(now - start) / ((end-start)/100)

so, for the values in your post you get 43/100 因此,对于您帖子中的值,您将获得43/100

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM