time

mysql test if time is within a time span over midnight

I am working on a mysql query that will search a database of entries that each have a time span to see if a user input time or time span falls within the entries spans. Ex user can input "13:00" or "13:00-16:00" the database has entries like so: id startTime endTime 1 08:00 12:00 2 20:00 03:00 3 1...

Drupal 6: Date module and displaying only DATE value, without TIME

Hi friends, I'm a newbie drupal guy, I use http://drupal.org/project/date module for my events date, but this module displays TIME as well as default, and I can't turn that off from configuration pages unless I'm a blind :/ is there any way to display only DATE value? Appreciate helps!! thanks a lot! ...

Subtracting dates in PHP

I have timestamps stored in the format YYYY-MM-DD HH:MM:SS (for example 2010-06-21 20:12:56). What would the best way to check how old the timestamp is? For the moment I am mainly interested in the number of days old. ...

Compare two times

hi everyone, i want to compare between two times the first one is getting by the resultset of an sql query like the following: res = req.executeQuery("SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(timespent))) FROM dailytimesheet where trackingdate=CURRENT_DATE and matricule=36;"); res.first(); { retour.append("<td><label style=\"backgro...

Python time.gmtime() returning time that's 5 hours ahead of system time

I have been scouring the google machine and have come up with nothing to answer this. When making calls to: time.gmtime() This ends up returning a time, as the subject line says, 5 hours ahead of my system time. I cannot figure out what is going on. time.tzname() returns the proper timezone. Aside from setting python to a timezone...

Display milliseconds in Excel

I am trying to display milliseconds in an Excel macro. I have a column of integers which are simply timestamps in milliseconds (e.g. 28095200 is 7:48:15.200 am), and I want to make a new column next to it which keeps a running average and displays the time in a "hh:mm:ss.000" format. I have tried multiple different routes, but I simply...

Difference between two time intervals in Python

I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online and I would imagine it would have something to do with the datetime and/or time modules. I can't get it to work properly and keep finding ...

How do I access the emulator control line in Android?

I'm trying to change the time zone on my Android emulator. I'm using Eclipse on a Windows 7 machine. To do this it says to enter some commands in the command line, but doesn't say how to access the command line! So how do I access the command line in Windows 7 using Eclipse? ...

Time to decimal time in Python

Which Python datetime or time method should I use to convert time in HH:MM:SS to decimal time in seconds? The times represent durations of time (most are less than a minute) and are not connected to a date. ...

How to use "currentTime" property for MpMoviePlayerController

Hi , I am trying to use the property of MPMoviePlayerController i.e "currentTime". But its showing warning "warning: 'MPMoviePlayerController' may not respond to '-currentTime' ". Can you please help me for how to use this property. Actually i am trying to find out the duration of time for played video . So that i will check with ti...

Windows 7 File Date Question

apologies for not asking a strictly programming question, but this will move on to programming once my confusion is cleared. i am about to write a program that can modify file date stamps like created, modified, last accessed date. as i am investigating on Windows 7, it seems to provide more date fields. exactly how many file attrib...

printing restaurant opening hours from a database table in human readable format using php

i have a table that lists the opening hours of restaurants. the columns are id, eateries_id, day_of_week, start_time, and end_time. each eatery is represented in the table multiple times because there is a separate entry for each day. see this previous question for more details: http://stackoverflow.com/questions/3070295/determine-if-a-r...

timeval to string (converting between the two)

I'm trying to pull the two components out of a timeval struct and place them into strings. I'm not having much luck with this. I've attempted casting and converting first to a long and then to a string. I need the most efficient way to do this. Any ideas? I do NOT want to convert to another data structure first (localtime, etc). I need...

How to calculate Mahalanobis distance between two time series of equal dimensions?

I am doing some data-mining on time series data. I need to calculate the distance or similarity between two series of equal dimensions. I was suggested to use Euclidean distance, Cos Similarity or Mahalanobis distance. The first two didn't give any useful information. I cannot seem to understand the various tutorials on the web. So, Gi...

maximum response time on keypress

Hi, I work for a company that develops psychological tests. One of these tests measures the reaction time of a candidate. Anyone has an idea of the maximum delay between a key press and the time that this key event is available? What are the dependencies? Is there a guaranteed maximum response time? I readed something about 5 - 25 ms. ...

Trouble implementing a real time program in C

I have a encoder which encodes a speech file(.wav) that i give as input. Now what i want to do is to write a program such that i can speak in the mic and at the same time the encoder can process it. Basically i want to record and process a speech signal in real time (a small delay can be tolerated). To do this i was thinking of making a ...

C++ Integer overflow problem when casting from double to unsigned int

I need to convert time from one format to another in C++ and it must be cross-platform compatible. I have created a structure as my time container. The structure fields must also be unsigned int as specified by legacy code. struct time{ unsigned int timeInteger; unsigned int timeFraction; } time1, time2; Mathematically the conv...

Can we change the device time using an application?

Hi everyone.. Want to know whether its possible to change the time of the iPhone through an application.. Is that level of dev access granted in iOS4? My gut feeling is no, but I'm looking for a definitive Yes/No answer if possible. Note: NSTimeZone class states 'Cocoa does not provide any API to change the time zone of the computer,...

How to make N runnables run for random periods of time, multiple times?

Let's say you have N runnable objects, and for each you want them to execute for random periods of time. Once a runnable object executes for that time period, you want to reschedule it to run for another random period of time. You want to be able to do this for each of the runnables, multiple times. Once a runnable is started, it should...

Install time for Android application?

Is there any way to determine programmatically the time at which an Android application was installed? I don't see anything in PackageInfo, etc. --EDIT-- To clarify, App A is installed at Time X. At some later time, Time Y, App B is installed. Is there any way App B can know when App A was installed? The link http://stackoverflow.com/qu...