time

tiemout for a function that waits indefiinitely (like listen())

Hello, I'm not quite sure if it's possible to do what I'm about to ask so I thought I'd ask. I have a multi-threaded program where threads share a memory block to communicate necessary information. One of the information is termination of threads where threads constantly check for this value and when the value is changed, they know it's...

Flex text change event

I'm tracking how fast does the text of a textArea change. If it changes faster than 500 ms then i don't want to do anything, but if it doesn't change in 500 ms, i want to call a method. I tried like this: public function textchangeListener(e : Event):void { if(((new Date).getTime() - changeTime)>500) { ...

javascript setTimeout() first argument: expression error

function Timer() { this.initialTime = 0; this.timeStart = null; this.getTotalTime = function() { timeEnd = new Date(); diff = timeEnd.getTime() - this.timeStart.getTime(); return diff+this.initialTime; }; this.formatTime = function() { interval = new Date(this.getTotalTime()); return interval.getHours() + ":" + inter...

php get future date time

I don't know how to explain this correctly but just some sample for you guys so that you can really get what Im trying to say. Today is April 09, 2010 7 days from now is April 16,2010 Im looking for a php code, which can give me the exact date giving the number of days interval prior to the current date. I've been looking for a threa...

Managing timezone in php with ics date/time format

Ok, I'm using an ICS parser utility to parse google calendar ICS files. It works great, except google is feeding me the times of the events at UCT.. so I need to subtract 5 hours now, and 6 hours when daylight savings happens. To get the start time I'm using: $timestart = date("g:iA",strtotime(substr($event['DTSTART'], 9, -3))); //$eve...

Time Zone offset number in Objective-c?

How can I get the Timezone offset in Objective-C (for iPhone OS 3)? Example GMT -5 is US Eastern Time... I want the -5. ...

Parsing Twitter API Datestamp

I'm using the twitter API to return a list of status updates and the times they were created. It's returning the creation date in the following format: Fri Apr 09 12:53:54 +0000 2010 What's the simplest way (with PHP or Javascript) to format this like 09-04-2010? ...

Suggest a good method with least lookup time complexity

I have a structure which has 3 identifier fields and one value field. I have a list of these objects. To give an analogy, the identifier fields are like the primary keys to the object. These 3 fields uniquely identify an object. Class { int a1; int a2; int a3; int value; }; I would be having a list of say 1000 object of th...

How to implement a countdown clock on a product launch web page?

I'm asking this on behalf of a certain corporation: http://www.microsoft.com/visualstudio/en-us/watch-it-live Things to bear in mind: It's 8:30 AM at different times depending on where you are in the world. For example, where I am, it is already 10 AM, whereas in Redmond it's still only 2 AM. That's probably the main thing, I guess...

SUM minutes SQL server

HI guys, My litle problem goes like this : I have this columns : PHONE_NR , TIME ( time field ), Meaning the calling telephone number and call duration. I need to group phone nr and sum the minutes. Filds looks like this : nr time 726028xxx 00:07:07 735560css 00:07:37 726028xxx 00:07:55 ...

process taking high time on Itanium server

Hi, we have an application which is recently migrated from PA-Risk server to itanium server. After migration we noticed that there is significant increase in time taken to complete a process. when we tracked the time taken by each part we found that the system time is 7.590000, user time is 3.990000 but elapsed time is 70.434882!! Due t...

MySQL: should I use "date" and "time" fields when I already have a timestamp field?

Hi, I have a MySQL table where there is a 'date_added' (date) field, 'time_added' (time) field and 'timestamp' (int) field. I found out afterwards that I can convert timestamp to a date or a time anyway, so so does that mean I could get rid of the other date/time fields and keep the timestamp only? Thanks in advance ...

How to printf a time_t variable as a floating point number?

Hi guys, I'm using a time_t variable in C (openMP enviroment) to keep cpu execution time...I define a float value sum_tot_time to sum time for all cpu's...I mean sum_tot_time is the sum of cpu's time_t values. The problem is that printing the value sum_tot_time it appear as an integer or long, by the way without its decimal part! I tried...

How do I check if a given datetime object is "between" two datetimes?

my_event = Event.objects.get(id=4) current_time = datetime.datetime.now() How do I do check if my current time is between them? my_event.start_time < current_time < my_event.end_time ...

(php) date and time

(php) how to get date and time into one string ($moment) and if it works, can mysql do this: SELECT * FROM table ORDER BY moment ASC ? ...

Decimal minutes

Hi not sure if this is the right forum for this but does anyone know the formula for converting decimal time in to hours and minutes ? IE 1.4 = 1hr 24mins thanks for any help and sorry if its the wrong forum ...

Javascript check if it has passed midnight since a certain time

I need to create a javascript function that checks if it has been a day since timeX (an instance of Date). I do NOT mean whether is has been 24 hours since timeX, but instead whether it has passed a midnight since timeX. I am a PHP expert, not a JavaScript one, so I was wondering if anyone here had any quick answers. Thanks! function...

How to change the date/time in Python for all modules?

When I write with business logic, my code often depends on the current time. For example the algorithm which looks at each unfinished order and checks if an invoice should be sent (which depends on the no of days since the job was ended). In these cases creating an invoice is not triggered by an explicit user action but by a background j...

measure time to execute single instruction

Dear all, Is there a way using C or assembler or maybe even C# to get an accurate measure of how long it takes to execute a ADD instruction? ...

Flot not displaying x axis labels correctly

I have to display a graph with date on the X axis and Amt on the Y axis. There will be 8 lines (series) each with n months data. When I plot the graph I am sending in 6 months data for sure.( one line's data is shown below) [1251701950000, 34.50553] [1254294030000, 27.014463] [1256972350000, 26.7805] [1259567970000, 33.08871] [12622464...