time

Using the windows command line can I time a process that I am running?

I am running a process on a windows command line, it is going to take a long time (30+ hours) and I want to know how long it takes to complete. Is there a way to do this? ...

Python: "global name 'time' is not defined"

I'm writing a silly program in python for a friend that prints "We are the knights who say 'Ni'!". then sleeps for 3 seconds, and then prints "Ni!" twenty times at random intervals using the random module's uniform() method. Here's my code: from time import sleep import random def knights_of_ni(): generator = random.Random() pr...

Calculating Time Difference

Hello... at the start and end of my program, I have from time import strftime print int(strftime("%Y-%m-%d %H:%M:%S") Y1=int(strftime("%Y")) m1=int(strftime("%m")) d1=int(strftime("%d")) H1=int(strftime("%H")) M1=int(strftime("%M")) S1=int(strftime("%S")) Y2=int(strftime("%Y")) m2=int(strftime("%m")) d2=int(strftime("%d")) H2=int(...

how to check depending on hour base

I have a field that has time and date in following format 2010-03-26 10:06:11 What I need is that if this time is within 4 hours of current time then show but if its over 4 hour then done show this record. thanks ...

Changing hours to days

Editing the question. I have SQL like this: `table1`.`DateField` >= DATE_SUB(NOW(), INTERVAL {$days} DAY Now 24 hours make a whole day. However, what if I want to do the query for the last 3 hours or so? My table1.DateField is in the format of 2010-03-10 10:05:50. Original post: If I have this 1 hour 2 hours 3 hours .. 24 h...

Converting time string to time or numeric format

I have a time column in the format of 00:00 00:30 01:00. I want to subset to certain hours but I don't understand how to convert it to the right format for the date i used as.date() is there someting similar? ...

Interpreting user inputted time with php (e.g. tomorrow, in three days, 30 days)

Taking user input such as "tomorrow", "in three days", "3 months 30 days", "march 30, 2011" and interpreting it into a timestamp usable by php. I feel like I've seen something like this before in a task management system. I'd like to use it for something a little different but I can't find anything precooked anywhere. Maybe I saw it on ...

Python Time Delays

I want to know how to call a function after a certain time. I have tried time.sleep() but this halts the whole script. I want the script to carry on, but after ???secs call a function and run the other script at the same time ...

Datetime/time issue with python (18 hours off)

I'm working on making a small ban system, and the snippet below will tell the client how much time of their ban is remaining. The problem: When you call Bans.timeleft_str(), rather then showing something less then a day, it will show the timestamp + 18 hours. Snippet: http://pastebin.com/Zumn0tLv This problem occurs if I change self.l...

Confusion while counting elapsed time in python?

So I wanted to compare the performance of python between 2.6 and 3.1, so I wrote this simple program test.py that will perform some basic lengthy operation: from time import time start = time() q = 2 ** 1000000000 q += 3 << 1000000000 print(q.__sizeof__(), time() - start) I didn't get what I expected, since after launching the command...

How do you have python scripts display how much time it takes to execut each process?

It was something like cMessage I think? I can;t remember, could someone help me? ...

C libcurl - measure download speed and time remaining

Hi, I am using the following code to download files from the internet: size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t written; written = fwrite(ptr, size, nmemb, stream); return written; } int main(int argc, char** argv) { FILE *downloaded_file; if ( (downloaded_file = fopen (download_path ...

execute php/javascript function after a certain amount of time has passed

Hey guys, I need to be able to execute either a php or jquery function to update a sql database every certain segment of time, 20 minutes for example, regardless of user activity on the website. Does anyone know the easiest way to do this? Thanks, any help is appreciated. ...

Need help creating a 24 minute day clock

Hello. I need help with some code that i am writing for a small text rpg. Its basically a clock that simulates a day, which will be 24 minutes instead of 24 hours. 1 second will equal one minute, and 1 minute will equal one hour. The clock will start from 12:00 and go to 12:00. I need ideas on how to write this code. This is code that i ...

GetTickCount function

Hi all, I have a question regarding GetTickCount function, I have two calls to this function in my code with several commands between them and the function in both calls returns same count. i.e. var1 = GetTickCount(); code : : var2 = GetTickCount(); var1 and var2 has same values in it. can someone help? ...

Convert 12hr date/time string to 24hr datetime

Like other questions asked here, im looking to do a simple conversion of time formats. I've found answers on how to do this in Perl, but not in Python. I have a string like so: on Jun 03, 02010 at 10:22PM and I'd like to convert it to a datetime object like this: Thu, 03 Jun 2010 22:22:00 -0000 I have sliced up my input like so: ...

Comparing dates and times in different formats using Python

I have lines of the following format in a file. Summary;meeting;Description;None;DateStart;20100629T110000;DateEnd;20100629T120000;Time;20100805T084547Z I need to create a function that has two inputs: time and date in the following formats Time: HH:MM and date as mmddyyyy. (These are strings). Now the function needs to read this line...

how to setting time in jquery?

hello.i'm newbie at web developing. i have some input form.i'm using jquery 1.4.2 inside that i have one textfield specially for input time. i want every one no need to type manually. and also make easy for every user. can you tell me how do i do that? ...

Querrying mysql table for times after the current one

Hi! I have a table with 1 column (bus departure times in format "14:32:15"). How to querry the table to show only departures that are after the current moment (after curtime())? E.g.: if it's 12 o'clock and my table has rows (10:15:00,11:20:00,12:30:00, ...), i want to have 12:30:00 returned. ...

Rounding a MYSQL datetime to earliest 15 minute interval in milliseconds (PHP)

Hi, I'm fetching a datetime from MYSQL which looks like: 2010-08-11 11:18:28 I need to convert it into the "floor" or the earliest 15 minute interval and output in milliseconds for another function. So, this case would be: 2010-08-11 11:15:00 in milliseconds Whoops! Sorry - need to clarify - I need code that will transform it int...