Questions tagged [duration]

The measure of continuance of any object or event within time.

The measure of continuance of any object or event within time.

See also the and tags.

1431 questions
41
votes
4 answers

Groovy time durations

Hi I'm trying to calculate the difference (duration) between two times in Groovy. e.g. start = "2010-10-07T22:15:33.110+01:00" stop = "2010-10-07T22:19:52.356+01:00" Ideally I would like the get the duration returned in Hours, Minutes, Seconds,…
Carl Bourne
  • 411
  • 1
  • 4
  • 3
40
votes
3 answers

MySQL storing duration time - datatype?

I need to calculate the time a user spends on site. It is difference between logout time and login time to give me something like "Mr X spent 4 hours and 43 minutes online". So to store the4 hours and 43 minutes i declared it like this: duration…
Juds
  • 507
  • 2
  • 5
  • 7
39
votes
11 answers

html5 display audio currentTime

I would like to display the current time of of an html 5 audio element and the duration of that element. I've been looking over the internet but can't find a functional script which allows me to display how long the audio files is and what the time…
Lenny Magico
  • 1,183
  • 5
  • 16
  • 28
38
votes
2 answers

Is there a way to have a Java8 duration of one year that accounts for leap years?

I need the number of days in a year and I wanted to use Java8's new time api. However, I can't do Duration.ofDays(365) because it doesn't account for leap years. And Duration.of(1, ChronoUnit.YEARS) doesn't fly because of…
user2272115
  • 986
  • 1
  • 10
  • 22
38
votes
13 answers

get duration of audio file

I have made a voice recorder app, and I want to show the duration of the recordings in a listview. I save the recordings like this: MediaRecorder recorder = new…
Simon
  • 2,328
  • 6
  • 26
  • 30
36
votes
4 answers

Using a duration field in a Rails model

I'm looking for the best way to use a duration field in a Rails model. I would like the format to be HH:MM:SS (ex: 01:30:23). The database in use is sqlite locally and Postgres in production. I would also like to work with this field so I can…
mwilliams
  • 9,946
  • 13
  • 50
  • 71
35
votes
7 answers

Spring boot 2 Converting Duration java 8 application.properties

I need to define Duration value (spring.redis.timeout) by application.properties. I was trying to use one point defined in Spring boot documentation: Spring Boot has dedicated support for expressing durations. If you expose a java.time.Duration…
CRISTIAN ROMERO MATESANZ
  • 1,502
  • 3
  • 14
  • 26
34
votes
2 answers

scrollTo speed/duration setting

Is there a way to speed up the behavior speed of scrollTo? I had a stab in the dark at speed and duration but don't work! window.scrollTo({ top: 1000, behavior:…
GoldenGonaz
  • 1,116
  • 2
  • 17
  • 42
32
votes
2 answers

How to unmarshal JSON into durations?

What is the idiomatic way to unmarshal into time.Duration in Go? How can I make use of time.ParseDuration?
user6216224
29
votes
7 answers

How to get the real, actual duration of an MP3 file (VBR or CBR) server-side

I used to calculate the duration of MP3 files server-side using ffmpeg - which seemed to work fine. Today i discovered that some of the calculations were wrong. Somehow, for some reason, ffmpeg will miscalculate the duration and it seems to happen…
SquareCat
  • 5,699
  • 9
  • 41
  • 75
28
votes
5 answers

Duration.ofDays generates UnsupportedTemporalTypeException

I am trying to learn the new Date & Time API. My code is working except for the last line: LocalDate current=LocalDate.now(); System.out.println(current); LocalDate personaldate=LocalDate.of(2011,Month.AUGUST,…
user2779311
  • 1,688
  • 4
  • 23
  • 31
28
votes
10 answers

How to get video duration from mp4, wmv, flv, mov videos

Alright. Actually i need mostly the mp4 format. But if it is possible to get for other types as well that would be nice. I just need to read the duration of the file. How can i do that with C# 4.0 ? So the thing i need is like this video is like :…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
27
votes
3 answers

How to get the precision of high_resolution_clock?

C++11 defines high_resolution_clock and it has the member types period and rep. But I can not figure out how I can get the precision of that clock. Or, if I may not get to the precision, can I somehow at least get a count in nanoseconds of the…
towi
  • 21,587
  • 28
  • 106
  • 187
27
votes
3 answers

Convert JodaTime duration to string

I have movie with duration 127 seconds. I wanna display it as 02:07. What is the best way to implement this?
fedor.belov
  • 22,343
  • 26
  • 89
  • 134
26
votes
4 answers

Snackbar duration and height

I'm trying to show a snackbar. After I click on a gesture detector, this snack has two buttons. The problem is that the snackbar appears for seconds and then disappears. So I have two questions: How to stop the snackbar from disappearing until…
Mee
  • 1,413
  • 5
  • 24
  • 40
1
2
3
95 96