duration

JFormattedTextField : input time duration value

别说谁变了你拦得住时间么 提交于 2019-11-26 02:59:02
问题 I want to use a JFormattedTextField to allow the user to input time duration values into a form. Sample valid values are: 2h 30m 72h 15m 6h 0h However I am having limited success with this. Can some one please suggest how this can be accomplished? I am OK if this result can be achieved using a JTextField as well. Thanks! If it is worth anything, here\'s my current attempt: mFormattedText.setFormatterFactory( new DefaultFormatterFactory( new DateFormatter( new SimpleDateFormat(\"H mm\"))));

How to get video duration, dimension and size in PHP?

时光毁灭记忆、已成空白 提交于 2019-11-26 02:50:49
问题 I want to know how to get the duration, dimension and size of uploaded video file in PHP. The file can be in any video format. 回答1: getID3 supports video formats. See: http://getid3.sourceforge.net/ Edit: So, in code format, that'd be like: include_once('pathto/getid3.php'); $getID3 = new getID3; $file = $getID3->analyze($filename); echo("Duration: ".$file['playtime_string']. " / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall". " / Filesize: ".

How to format a duration in java? (e.g format H:MM:SS)

时光怂恿深爱的人放手 提交于 2019-11-25 23:07:44
问题 I\'d like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration. 回答1: If you're using a version of Java prior to 8... you can use Joda Time and PeriodFormatter. If you've really got a duration (i.e. an elapsed amount of time, with no reference to a calendar system) then you should probably be using Duration for the most part - you can then call toPeriod (specifying whatever PeriodType you want to reflect