seconds

Seconds to Time in XSLT

大憨熊 提交于 2019-11-28 14:16:50
I'm not asking a question actually. I signed up stackoverflow to give something back to a community that has helped me so many times. If you are using XSLT 1.0 there are no built-in time calculations. I came up with this to convert seconds into minutes and hours. I hope this helps someone! <xsl:template name="format-duration"> <xsl:param name="value" /> <xsl:variable name="minutes" select="floor($value div 60) mod 60" /> <xsl:variable name="seconds" select="$value mod 60" /> <xsl:variable name="hours" select="floor($value div 3600)" /> <xsl:if test="$hours"> <xsl:if test="$hours < 10"> <xsl

Lat Long to Minutes and Seconds?

老子叫甜甜 提交于 2019-11-28 13:30:35
Google Maps gives me the Lat and Long of a location in decimal notation like this: 38.203655,-76.113281 How do I convert those to Coords (Degrees, Minutes , Seconds) 38.203655 is a decimal value of degrees. There are 60 minutes is a degree and 60 seconds in a minute (1degree == 60min == 3600s). So take the fractional part of the value, i.e. 0.203655, and multiply it with 60 to get minutes, i.e. 12.2193, which is 12 minutes, and then repeat for the fractional part of minutes, i.e. 0.2193 = 13.158000 seconds. Example in python: def deg_to_dms(deg): d = int(deg) md = abs(deg - d) * 60 m = int(md)

Linux task schedule to Hour, minute, second

最后都变了- 提交于 2019-11-28 11:43:26
问题 I'm trying to run a shell script at a specific time up to it's seconds (H:M:S) , but so far all programs such as at only go up to a specific minute (not second). I don't want to use sleep since it's not accurate. For some reason it ended couple of hours earlier than it was supposed to! 回答1: Your question doesn't seem to define accuracy, but there is always some jitter in scheduling in electronic devices. You might use quartz to schedule to the second. You could also use at or cron to schedule

How to get time difference between two timestamps in seconds with jQuery?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 16:21:12
问题 I want to display x seconds ago based on a MySQL Timestamp. I found the plugin called timeago But I cannot find a way to make it display only seconds. I'm OK with 61 seconds, or 300 seconds. Any way to convert the output to seconds with timeago, or with pure jQuery / JavaScript ? Thanks for any help ! Edit: Sample Case : $time1 = "2014-02-02 23:54:04"; // plus PHP ways to format it. //$time2 = NOW() , or date(); whatever. I just want to get how many seconds since $time1 . Edit 2: Working code

PHP: add seconds to a date

只谈情不闲聊 提交于 2019-11-27 15:59:09
I have $adate; which contains: Tue Jan 4 07:59:59 2011 I want to add to this date the following: $duration=674165; // in seconds Once the seconds are added I need the result back into date format. I don't know what I'm doing, but I am getting odd results. Note: both variables are dynamic. Now they are equal to the values given, but next query they will have different values. If you are using php 5.3+ you can use a new way to do it. <?php $date = new DateTime(); echo $date->getTimestamp(). "<br>"; $date->add(new DateInterval('PT674165S')); // adds 674165 secs echo $date->getTimestamp(); ?> Just

PHP — Convert milliseconds to Hours : Minutes : Seconds.fractional

佐手、 提交于 2019-11-27 14:57:43
问题 I've got a script that takes in a value in seconds (to 2 decimal points of fractional seconds): $seconds_input = 23.75 I then convert it to milliseconds: $milliseconds = $seconds_input * 1000; // --> 23750 And then I want to format it like so: H:M:S.x // --> 0:0:23.75 Where 'x' is the fraction of the second (however many places after the decimal there are). Any help? I can't seem to wrap my mind around this. I tried using gmdate() but it kept lopping off the fractional seconds. Thanks. 回答1:

Java getHours(), getMinutes() and getSeconds()

依然范特西╮ 提交于 2019-11-27 11:44:46
As I know getHours() , getMinutes() and getSeconds() are all deprecated in Java and they are replaced with Calendar.HOUR_OF_DAY , Calendar.MINUTE , Calendar.SECOND . These will in fact return the hour, minute and second for that particular moment. However, I would want to retrieved the hours and minutes from a Date variable. For instance, say the time retrieved from database is time = Thu Jan 01 09:12:18 CET 1970; int hours = time.getHours(); int minutes = time.getMinutes(); int seconds = time.getSeconds(); By retrieving the hours, minutes, and seconds, I get hours = 9 minutes = 12 seconds =

jQuery: Wait/Delay 1 second without executing code

孤街醉人 提交于 2019-11-27 09:15:30
问题 I can't get the .delay method working in jQuery: $.delay(3000); // not working $(queue).delay(3000); // not working I'm using a while loop to wait until an uncontrolled changing value is greater than or equal to another and I can't find any way to hault execution for X seconds. 回答1: $.delay is used to delay animations in a queue, not halt execution. Instead of using a while loop, you need to recursively call a method that performs the check every second using setTimeout : var check = function

Seconds to Time in XSLT

与世无争的帅哥 提交于 2019-11-27 08:19:12
问题 I'm not asking a question actually. I signed up stackoverflow to give something back to a community that has helped me so many times. If you are using XSLT 1.0 there are no built-in time calculations. I came up with this to convert seconds into minutes and hours. I hope this helps someone! <xsl:template name="format-duration"> <xsl:param name="value" /> <xsl:variable name="minutes" select="floor($value div 60) mod 60" /> <xsl:variable name="seconds" select="$value mod 60" /> <xsl:variable

Lat Long to Minutes and Seconds?

♀尐吖头ヾ 提交于 2019-11-27 07:44:19
问题 Google Maps gives me the Lat and Long of a location in decimal notation like this: 38.203655,-76.113281 How do I convert those to Coords (Degrees, Minutes , Seconds) 回答1: 38.203655 is a decimal value of degrees. There are 60 minutes is a degree and 60 seconds in a minute (1degree == 60min == 3600s). So take the fractional part of the value, i.e. 0.203655, and multiply it with 60 to get minutes, i.e. 12.2193, which is 12 minutes, and then repeat for the fractional part of minutes, i.e. 0.2193