time

C++: how to convert date string to int

Hi I need a procedure that convert string time to int. Which support all this formats under unix: "Wed, 09 Feb 1994 22:23:32 GMT" -- HTTP format "Thu Feb 3 17:03:55 GMT 1994" -- ctime(3) format "Thu Feb 3 00:00:00 1994", -- ANSI C asctime() format "Tuesday, 08-Feb-94 14:15:29 GMT" -- old rfc850 HTTP form...

Index time boosting is not working with boosting value in document level

We are having 10 documents (all 10 documents with name_s="john" or name_s="john abraham") with boosting value 10.0 in doc level out of 100 documents. DataImportHandler is used to index the documents in xml. We gave omitNorms="false" in a field called "text" and having schema.xml configured as below. Default query field is "text", when i ...

MySQL Calculate Time Online

Would it be possible to calculate time online from a table of something like logtype time ---------------- login 2:30 logout 2:45 login 3:20 logout 4:50 login 5:00 login 5:10 logout 6:00 It would have extra logins because sometimes the server crashes and doesn't add logout. Can you do somethi...

Any api to change iphone's system time?

is that possible to update system time programatically in ios? ...

Activate Python program every 5 minutes?

Is there an easy way to get a python code segment to run every 5 minutes? I know I could do it using time.sleep() but was there any other way? For example I want to run this every 5 minutes: x = 0 def run_5(): print "5 minutes later" global x += 5 print x, "minutes since start" That's only a fake example but the idea is ...

Groovy time durations

Hi I'm trying to calculate the difference (duration) between two times in Groovy. e.g. start = "2010-10-07T22:15:33.110+01:00" stop = "2010-10-07T22:19:52.356+01:00" Ideally I would like the get the duration returned in Hours, Minutes, Seconds, Milliseconds. Can anybody please help. I've tried to use Groovy's duration classes but ...

Will including javascript files from googles site slow my load time?

so im trying to include this file for an application http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js would including it as this url slow the load time of my site when using an application that requires it? as opposed to downloading this file and including it locally ...

Calling a function for a period of time

I want to make a call - either a function call or doing some condition for a PERIOD of time ... typically 10 - 20 seconds. I would get some user input for the amount of time and do that ... What is the proper function to use on Linux/Unix systems? gettimeofday seems to be the way to go ... or perhaps time_t time(time_t *t) ... seems...

is anybody doing anything about 2038 time_t bug?

Possible Duplicate: What should we do to prepare for 2038? I don't mean 'people' in the abstract. I mean are you doing anything and if so what? I am an ancient programmer and recall when I wrote COBOL in the late 70's saying to others in my team "you know - this isn't going to work in 2000". To which the reply was "yeah but t...

python time differences

I have two time objects Example time.struct_time(tm_year=2010, tm_mon=9, tm_mday=24, tm_hour=19, tm_min=13, tm_sec=37, tm_wday=4, tm_yday=267, tm_isdst=-1) time.struct_time(tm_year=2010, tm_mon=9, tm_mday=25, tm_hour=13, tm_min=7, tm_sec=25, tm_wday=5, tm_yday=268, tm_isdst=-1) I want to have the difference of those two? How could ...

Assign to a file a progressive number according to time

There is a way to assign to a file, lets call it abc.txt, a progressive number, that I suppose should come from the time set? So that the name of the file could become for example abc_5367879938763.txt ...

How to get an event in a service when the screen is touched ?

I would like to implement a service in Android that basically should monitor the time elapsed since the user didn't touched the screen. For example the user opens Internet or Adobe Reader, starts reading and don't interact anymore withe the touchscreen. I want that my running service know the time since the user didn't touched the screen...

Calculating relative time offset

I was reading this article about relative time calculation The problem is that the results are wrong due to the time offset. My webpage is Greek. So how should i modify that function to work correctly, including the GMT+2 or GMT+3 hours offset? ...

In Ruby on Rails, what's the difference between DateTime, Timestamp, Time and Date?

In my experience, getting dates/times right when programming is always fraught with danger and difficulity. Ruby and Rails have always eluded me on this one, if only due to the overwhelming number of options; I never have any idea which I should pick. When I'm using Rails and looking at ActiveRecord datatypes I can find the following ...

Struggling to parse (bash) time command.

Hi there. I'm struggling to parse the output of the time command in bash - and even to stop it from printing out its output when I call it. This is my test code: #!/bin/bash TIME=`time ls -lh > /dev/null` echo "Testing..." echo $TIME This currently prints out: {blank-line} real 0m0.064s user 0m0.002s sys 0m0.005s Testing {b...

Convert UTC to days, hours minutes etc in C

I have a a long which has the time in UTC format as a timestamp for some data, now I want to convert it to this format: month 1-12 Day 1-31 24 Hour format 0-23 minute 0-59 second 0-59 subsecond nanoseconds 0-999,999,999 now the nanoseconds can obviously be set to 0 as it doesnt need to be that accurate. What is the best method to do t...

[C#] How to write this statement into coding?

[C#] How to write this statement into coding? I declare my Video Time Value as "VideoTime.Value" **if (Video Time Value is equal to 4 sec) { MessageBox.Show("Video Paused"); }** ...

implement time delay in c

Hi! I don't know exactly how to word a search for this.. so I haven't had any luck finding anything.. :S I need to implement a time delay in C. for example I want to do some stuff, then wait say 1 minute, then continue on doing stuff. Did that make sense? Can anyone help me out? ...

Date time format

i want to set a variable to a particular date like this in php..how to write this function in php? jsmyStartDate = new Date('April 1, '+curYear+' 1:59:59'); ...

Rails models: How to treat time constants correctly?

Hi there, I know the following model code is not correct: as models get loaded only on server boot, time "constants" are loaded at that time only, too. class Article < ActiveRecord::Base def expiring? if (self.enddate - Time.now) <= 1.day true else false end end end What do I have to correct how, so that...