time

Fastest way to perform time average of multiple calculations in SQL?

I have a question about the fastest way to perform a SQL Server query on a table, TheTable, that has the following fields: TimeStamp, Col1, Col2, Col3, Col4 I don't maintain the database, I just can access it. I need to perform 10 calculations that are similar to: Col2*Col3 + 5 5*POWER(Col3,7) + 4*POWER(Col2,6) + 3*POWER(...

How to return the time, which would take for a method to finish it's job?

I have a simple recursive algorithm, which returns Fibonacci numbers: private static double fib_recursive(int n){ if(n <= 2) return 1; else return fib_recursive(n-1) + fib_recursive(n-2); } Now my task is to return the time, which this method would take to calculate the 400-th fibonacci number on a given computer e.g. fib_recu...

Have python run script at X:00 am

Following up on, http://stackoverflow.com/questions/3553340/with-python-intervals-at-x00-repeat Using threading, How can I get a script to run starting at 8:00 am stop running at 5:00 pm The solution should be coded within python, and be portable tiA ...

Does Time.to_i always return number of seconds since EPOCH in UTC?

Is the timezone difference always ignored, regardless in which zone the time is expressed in? Intuitively, the number of seconds passed since EPOCH should be higher for those who are, for example, in UTC+2. However, this seems not to be the case. ...

Set Toast Appear Length

Is there anyway I can tell a Toast Notification to show up only for a specified amount of time. Generally shorter then a regular toast message. ...

How do you convert an ISO 8601 date to a UNIX timestamp in Ruby?

I've been trying Time.parse() and Date.parse(), but can't see to figure it out. I need to convert a date in the form "2007-12-31 23:59:59" to a UNIX timestamp. Something like PHP's strtotime() function would be perfect. ...

time difference between my and betfair server

There is about 38-40 seconds difference between my and betfair server time. I don't want to use some dec/inc in my time to manage.i want to be sync with betfair server time. Please Help. ...

C GetTickCount (windows function) to Time (nanoseconds)

Hello guys, I'm testing one code provided from my colleague and I need to measure the time of execution of one routine than performs a context switch (of threads). What's the best choice to measure the time? I know that is available High Resolution Timers like, QueryPerformanceCounter QueryPerformanceFrequency but how can I translate...

How can I convert this string to a standard date in java?

Earlier I posted the following question: http://stackoverflow.com/questions/3791984/how-can-i-convert-this-date-in-java But now I would like to know how I can convert this string into a date/time. 2010-03-15T16:34:46Z For example: 03/15/10 UPDATED: String pattern = "MM/dd/yy 'at' HH:mm"; Date date = new Date(); ...

Time difference in Javascript

I have a textbox where I get the time as HH:MM AM/PM(like 5:30 PM). I want to validate the time whether it is 1 hour greater than the current time or not. How can I do this using javascript? ...

How to get PTP time from a networked time source?

I've been tasked with syncing a time critical process for logging data from a PLC with a PTP (Precision Time Protocol, IEEE 1588) time source. A quick look at the available libraries all turn up nothing but IVI-C and IVI-COM based implementations. Would it be better to roll my own managed library for reading time from a PTP time source...

python - Week number of the month

Hi. Does python offer a way to easily get the current week of the month (1:4) ? ...

Java how to calculate time differences

How can I calculate the time differences in 24 hour if the user input is 2255 and 2305 the output should be 10 minutes. I got an idea is to separate the input to 2 parts, 2 digits and 2 digits. the first 2 digits is the hour, times it to 60 to make it to minutes. Then plus it with the second 2 digits and then calculate the differences. I...

how to calculate the other country time. using my local machine time in c#?

how to calculate the other country time. using my local machine time in c#? Example: My system having India time and my array contains all the countries GMT time. How to do the calculation to get the other country time? if my time is 5.00 P.M if the country is Pakistan it should show 4.30 p.m ...

Trigger an event when system locks/unlocks on Windows XP

Please help me to find a way to track lock/unlock time on my WinXP machine. I've tried windows scheduler - it only logs logins, not locks. Any alternatives? In Miranda's source code I saw implementation via IdleObject tracker, but this way is too long. May be an AutoIt script? Time tracking program (freeware)? ...

Order files by creation time to the millisecond in Bash

Hi there, I need to create a list of files which are located on my hard disk in order of when they arrived on the hard disk. To do so, I have used the following: ls -lat which lists all the files in date/time order, however, it only orders them to the nearest second. The problem here is that there are thousands of files and every so...

Difference between two clock hours

So the scenario is as follows, I have two columns "StartHour" and "EndHour". Both are stored as Integers. F.ex values can be StartHour : 30 (clock time 00:30) and EndHour : 630 (clock time 06:30) The output I'd like from this is 360 (minutes). I need the difference between the two fields, and I need them in minutes. I can process the...

Ruby: Convert time to seconds?

How can I convert a time like 10:30 to seconds? Is there some sort of built in Ruby function to handle that? Basically trying to figure out the number of seconds from midnight (00:00) to a specific time in the day (such as 10:30, or 18:45). ...

How to run java function for only 30 minutes

I need to create a java function that will only run for 30 minutes, and at the end of the 30 minutes it executes something. But it should also be able to self terminate before the given time if the right conditions are met. I don't want the function to be sleeping as it should be collecting data, so no sleeping threads. Thanks ...

Add seconds (in fixnum format) to a datetime, Rails

I need to pass a variable to my view with Time.now + @seconds in time format (i.e. 12pm + 3600 seconds = 1:00pm, which goes to the view). Time.now + @seconds #seconds is a fixnum doesn't work because "Time can't be coerced into Fixnum". How then can I generate this simple result? ...