time

Compare time in javascript

I need to create a function to filter data according to time. I have a table of flights with departure time in related rows, what i need is, i will put to time filter fields to my form, for hiding flights before and after selected time. In other words, flighs bettween selected time interval will be visible. I have no problem with gett...

Adding times in ruby on rails

Hello, I currently have a model called Job which has an attribute called CPU. This corresponds to the CPU time that a job was running. I would like to add all the time attributes of all the jobs for a specific date. This column is in the time format 00:00:00. Therefore I thought this would work: def self.cpu_time sum(:cpu) end Which...

How can I convert a Python datetime object to UTC?

I have a python datetime object which I would like to convert to UTC. I am planning to output it in RFC 2822 format to put in an HTTP header, but I am not sure if that matters for this question. I found some information on this site about converting time objects, and it looks simpler that way, but this time I really want to use datetime ...

Comparing hours and minutes in AS3

Is there a way to compare the current time to a bunch of times (loaded from XML) and have it figure out which is the closest to the current time? ...

Java time calculation problem

Hi, I need to solve below using java 6 api. The inputs are start time , end time and a given time t in a given time zone . All Times must be in 24 hr format = HH:mm The program must return values x such that: f(t)= 0 , for start<=t<=end = x , for t outside start and end where x is the interval in seconds fo...

validate time GMT offset and striping with regex ?

// create a string $string = '+7'; // try to match the beginning of the string if(preg_match("{-15 to +12}", $string)) { // if it matches we echo this line return {strip all the + sign} echo 'its a valid gmt time'; } else { echo 'not valid gmt time'; } Question: please see the first {} on preg_match, ...

Flash - time from press

I am working on a little project, what's goal is a working widget system in Flash - by creating a separate class, and loading Flash movies into this, then dragging them around the screen. I ran into a little problem when I was writing the dragging code: I can not found any code what can easily get the time from the function call. To be ...

PHP - linux/unix CTIME (inode change time) is being set when it's only being modified.

According to: http://www.php.net/manual/en/function.filectime.php "In most Unix filesystems, a file is considered changed when its inode data is changed; that is, when the permissions, owner, group, or other metadata from the inode is updated." However, running Debian linux (uname -r: 2.6.26-2-686) when I access and write to a file, s...

Inserting time into a time column with Ruby on Rails

Hello, I have run with a problem which i believe is Active Records fault. I am parsing an XML file which contains jobs. This xml file contains nodes which indicate walltime in the time format 00:00:00. I also have a model which will accept these jobs. However, when the time is larger than an actual 24H time, Active record inserts it as N...

Javascript: How to turn the time (stored as a fraction) into a readable string?

I have the time stored as a fraction (done so it can be displayed on a graph), e.g. 15.5 is 3.30pm and 23.25 is 11.15pm. I need to turn those numbers into strings in the format HH:MM:SS. Is there a simple way of doing this? ...

How to set the same time on both computers connected over network in .NET?

Hi, I'm trying to be fair play in my network game and I would like to mark as winner the player who won first and it depends on time but DateTime.Now is local time and both computers may have set different times on their machines. Is there something that .NET provides for this case? Thanks! ...

Proper way to save a 1970 type date

I have a date that looks like 1003029303, which I guess is what's known as a linux UNIX time stamp. What format should I save it as in a mysql database? I don't suppose that an int(10) is the right way. `gottime` int(10) ...

jQuery tools date time picker

Hi everyone, can anyone recommend me some jQuery tools date time picker, on official jQuery tools site there is only date picker but I am looking for plugin that has time extension. Thanks a lot. ...

Converting a time string to UNIX timestamp

Hi How can I convert a time string like this: 30/7/2010 to a UNIX timestamp? I tried strtotime() but I get a empty string :( ...

Relative time function in js for format YYYY-MM-DDTHH:MM:SS+0000

Hey, I was wondering if anyone knew how I could parse this type of date format: 2010-07-26T18:02:46+0000 into the relative time such as "30 seconds ago" I already have a function which does it for a similar but different time format: function relative_time(time_value, is_relative) { var values = time_value.split(" "), ...

How do I find out wether a locale uses 12 or 24 hour time in Java?

In Java, I want to print just the time of day in hours and minutes and want it to correctly switch between, e.g., "13:00" and "1:00 PM" according to the locale. How do I do this? ...

Calculate time between two times Android

basically i have one time currentTime = DateFormat.getTimeInstance().format(new Date()); and i want to calculate how much time has past since currentTime. any ideas? ...

vbscript time zones and Daylight Savings

I'm looking for an easy way to get UTC times and date/time information in vbscript, even while specifying a time zone. I need to be able to get the current time in a time zone of my choice. I have seen postings on the web for functions that determine DST, but I'd rather not use something I'd have to update if DST or time zones switched...

In mysql is "WHERE a = 2 AND b = 'Wiliam'" the same as "WHERE b = 'Wiliam' AND a = 2"?

In mysql, does the order of the WHERE clauses affect the time that it takes the server to process the query? I know that the queries are compiled and optimized, but I don't know if that optimization changes the order of the WHERE clauses so in a hypothetic case it will take less time to process a query that first selects the results wit...

How-to: Find a good mathematical algorithm to distribute measuring points over time?

Hi folks. I'm currently implementing a software that measures certain values over time. The user may choose to measure the value 100 times over a duration of 28 days. (Just to give an example) Linear distribution is not a problem, but I am currently trying to get a logarithmical distribution of the points over the time span. The str...