Questions tagged [timeunit]
55 questions
0
votes
1 answer
Extract PI OSIsoft Monthly Interval in Python
I am trying to extract the sum of PI data from OSIsoft 10m (10 minute) data in a one (1) month interval using Python pandas. However, I either get an error from OSIsoft or Python when I choose the internal notation as "M" for OSIsoft or "1mo" for…

user2100039
- 1,280
- 2
- 16
- 31
0
votes
1 answer
How to use String.format(Locale, ...)?
I am new in Android development and I'm trying this code:
String hms = String.format("%02d:%02d:%02d",
TimeUnit.MILLISECONDS.toHours(milliSeconds),
TimeUnit.MILLISECONDS.toMinutes(milliSeconds) -
…

Fernando K
- 1
- 1
0
votes
2 answers
Alternatives for TimeUnit.SECONDS.sleep(1); SpigotMC/ SpigotMC event not running
I was trying to make a Minecraft plugin while having this problem, but I thought this would be more of a Java discussion
So I tried to make a spawner that would spawn a chicken every second (for testing, it would become every minute when I'm done),…

GD Vicious bee
- 47
- 11
0
votes
1 answer
Get a dateTime before some hours from a specified dateTime Kotlin Android
I want to get a dateTime which is some hours before the specified datetime. The datetime will be in string format and depending on configuration, need a datetime n hours before the given time( example 3 or 4 hours before the given time).
The time…

Joseph
- 1,060
- 3
- 22
- 53
0
votes
1 answer
Get only hours and minutes Java
I have problem. I need to calculate only hours and minutes, not days
import java.util.concurrent.TimeUnit;
public class TimeUtils {
public static String millisecondToFullTime(long millisecond) {
return timeUnitToFullTime(millisecond,…

anduplats
- 885
- 2
- 14
- 24
0
votes
1 answer
scheduleAtFixedRate method - change TimeUnit argument?
I'm using the SchduledExecuterService class to run some code repeatedly using the scheduleAtFixedRate() method.
exec.scheduleAtFixedRate(new Runnable() {
public void run() {
//some code
}
}, 1, 1, TimeUnit.SECONDS);
The problem is…

Raptor_Guy
- 9
- 1
- 4
0
votes
1 answer
Question regarding output shown after converting nanoseconds to seconds
I'm having trouble understanding the output generated by the code below.
The code segment:
long startTime= System.nanoTime();
//method that I am measuring.
long endTime = System.nanoTime();
long elapsedTime = endTime…
user6835286
0
votes
2 answers
Converting difference between 2 dates to days in java 7
I want to compare 2 dates in java and need to convert the difference between the 2 dates to days
//Setting up date
Calendar cal = Calendar.getInstance();
cal.set(2019, 5, 16);
Date d = cal.getTime();
Output would be something like this : Sun Jun…

Karthik
- 145
- 1
- 2
- 12
0
votes
0 answers
User Inputs During a while loop; Stops/Blocks While loop - Java
I am trying to stop a while loop w/user input in java. I am utilizing the scanner utility. However, the scanner stops the loop from progressing. How can I make it so that the code enables user input at any time without blocking the loop?
CODE…

Aiden Hong
- 3
- 3
0
votes
0 answers
how to change the time unit for survfit results in r
I am working to create a nice looking plot of the survfit return in R. The default time unit on the x-axis is a long integer, which I am assuming is seconds or milliseconds. This persists no matter what the unit of time is that is originally passed…

lolynns
- 339
- 1
- 8
0
votes
1 answer
How to set a reference to a property placeholder for an ESB mule enumerated type attribute
I am currently developping an ESB (3.7.0 CE) mule application and I am using Poll component with fixed-frequency-scheduler. I would like to externalize timeUnit scheduler's attribute as below:

E. Armanidi
- 1
- 1
0
votes
2 answers
Request a better way to limit milli second digits
I was attempting to limit the number of milliseconds displayed in an Android UI, and I came up with this:
Long milli = TimeUnit.NANOSECONDS.toSeconds(nanos);
String partB = milli.toString().substring(0,2);
String partA = String.format("%d:%d:%d.", …

MrMagoo
- 67
- 1
- 12
0
votes
1 answer
Calculating Elapse Time
This program will display the start time, end time and elapse time of a program to the user. For example if the program started at 09:23:45 and ended at 09:23:55 then the output to the user would be as such, start time: 09h:23m:45s end time:…

mar
- 43
- 1
- 6
0
votes
1 answer
Any lib to convert timeunit by amount of time?
Input unit is second, then output unit varies by amount of time.
example :
50 -> 50sec // less than a min
80 -> 1min 20sec
3700 -> 1hour 1min 40sec
216040 -> 30day 40sec
...
Is there any java lib that can do this?
It will be perfect if it suppors…

Deckard
- 1,409
- 6
- 32
- 59
0
votes
1 answer
Timeunit not being parsed in second Class
I've ran into a issue when I'm trying to create a game that has a time based element to it. In it, I've gave the user 300 Seconds to guess a number.
If the player runs out of time then the code would stop a while loop I've created, and print that…

Jordon Myers
- 147
- 1
- 1
- 9