duration

Charting duration of time

别说谁变了你拦得住时间么 提交于 2020-01-15 08:13:16
问题 I'm fairly certain from the reading I did prior to this post that a Gantt chart is what I will need to create, however I don't know if that is the correct route or not. Need to plot data of start and end times as one unit on an Excel chart, with date on the Y-axis and hour of day on the X axis. The format of the start and end times are Excel numbers which is adding another curveball into the mix. 回答1: If the chart below is of the type you require: then I'd suggest choosing a Stacked Bar

Charting duration of time

会有一股神秘感。 提交于 2020-01-15 08:09:18
问题 I'm fairly certain from the reading I did prior to this post that a Gantt chart is what I will need to create, however I don't know if that is the correct route or not. Need to plot data of start and end times as one unit on an Excel chart, with date on the Y-axis and hour of day on the X axis. The format of the start and end times are Excel numbers which is adding another curveball into the mix. 回答1: If the chart below is of the type you require: then I'd suggest choosing a Stacked Bar

Display and format Django DurationField in template

时光毁灭记忆、已成空白 提交于 2020-01-13 08:15:29
问题 Im using Django 1.8, and i have one of my field defined as DurationField, but i dont find any way to correctly display it on my template, if i output it like this: {{runtime}} i just get 0:00:00.007980 is there any filter or any other way of displaying something more like 2hours 30 min 回答1: No, I don't think there is any built in filter to format a timedelta , it should be fairly easy to write one yourself though. Here is a basic (and untested) example: from django import template register =

Calculate Duration

末鹿安然 提交于 2020-01-12 17:29:06
问题 I have a small android problem, I have a requirement to have a timer to calculate the duration from the time a specific activity was open till a certain button in that activity is clicked, simply how long the activity was open. While googling around I found TimerTask but this seems to run a thread for a certain interval only though and doesent seem ideal for the job from my little Android experience Any idea on how to calculate the duration? Preferably in a very simple manner Any help is very

Toast Message in Android

荒凉一梦 提交于 2020-01-11 05:57:48
问题 Friends, In my application Toast message is Displayed in Activity say UserActivity.class.. That activity includes a button, in which it will Redirect to next Activity in OnClick of button.. What i want is that my Toast Message should display in UserActivity until user taps Button, if user Taps the button my toast message has to be Disappear and Next activity will appear.. Is it possible to do like this, if so how its possible? Thanks Venkatesh. 回答1: This is quite simple. Just call the cancel

Java format hour and min

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-10 04:28:11
问题 I need to format my time string such as this: int time = 160; Here's my sample code: public static String formatDuration(String minute) { String formattedMinute = null; SimpleDateFormat sdf = new SimpleDateFormat("mm"); try { Date dt = sdf.parse(minute); sdf = new SimpleDateFormat("HH mm"); formattedMinute = sdf.format(dt); } catch (ParseException e) { e.printStackTrace(); } return formattedMinute; // int minutes = 120; // int h = minutes / 60 + Integer.parseInt(minute); // int m = minutes %

Calculate duration between momentjs timestamps in UTC

非 Y 不嫁゛ 提交于 2020-01-07 04:24:09
问题 I am having a hard time to calculate the duration (difference in time) of two timestamps. There is a timestamp I receive from the server in the following format: start # => "2017-05-31 06:30:10 UTC" (This is basically rubys DateTime.now.utc ) I want to see how many hours have passed since then until as of right now. The calculation happens in the angularjs frontend only. I tried the following: var start = moment("2017-05-31 06:30:10 UTC", "YYYY-MM-DD HH:mm:ss Z").utc(); var now = moment.utc()

Obtaining video information using FFMPEG, or possibly HTML5

一个人想着一个人 提交于 2020-01-07 04:21:34
问题 I'm making a video gallery and would like to pull some info about the video for displaying. Does anyone know how I would go about retrieving the video duration using ffmpeg? Is it possible to get this info using HTML5? Thanks. 回答1: Use exec function in php http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/9448/how-to-get-video-duration-with-ffmpeg-and-php 回答2: What I do (on Linux) is this: tcprobe -i $FILE | tail -n1 | cut -d '=' -f3 tcprobe is from the

Calculate duration in R

拥有回忆 提交于 2020-01-03 05:09:05
问题 I wonder if there is an easy way to calculate the duration. I have a dataset where the a parameter, called m , varies between the values -1 and 1 during time. I want to calculate: The total duration (time in hours) of cases where m=-1 and m=1 respectively How long is each period of cases where m=-1 and m=1 respectively is m<-c(1,1,1,1,-1,-1,-1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1) Time <- seq.POSIXt(as.POSIXct(Sys.Date()), as.POSIXct(Sys.Date()+1), by = "1 hour") 回答1: I'd use package

Parsing a Duration String in Kotlin

前提是你 提交于 2019-12-30 11:29:22
问题 I'm working on a Android application and I need to parse a duration string of this form "00:00:00.000" (Ex: "00:00:38.47" or "00:03:27.11"). My final goal is to convert this string into a double of total seconds with milliseconds to get a progression percent. I already looked into SimpleDateFormatter, but I'm having some issue understanding how it works or how I'm supposed to use it. I've tried this: val timeString = "00:01:08.83" val df = SimpleDateFormat("HH:mm:ss.SS") df.parse(timeString)?