time

How to parse of EXIF time stamps with Bash script

As a bash script rookie, detailed answers would be appreciated. :) I am trying to write a bash script that parses JPEG EXIF time stamps output from the exiv2 commmandline utility, which gives me typical output like: Image timestamp : 2010:07:27 17:38:52 Is there a way to parse the time stamp so that its components, like year, mont...

One hour increment in R, zoo

Hello How can I add one hour to all the elements of the index of a zoo series? I've tried newseries <- myzooseries index(newseries) <- index(myzooseries)+times("1:00:00") but I get the message Incompatible methods ("Ops.dates", "Ops.times") for "+" thanks My index is a chron object with date and time but I've tried w...

Ruby on Rails time match database start and end times

I've been banging my head at this one: I have a table with columns start_time an end_time as well as start_date and end_date, and I have a Time object called test_time. I need to be able to match these values in a sql query. ie. Reservation.find :all, :conditions => ["'start_time' <= ? AND 'end_time' >= ?", test_time, test_time]...

find ALL methods of getting current date/time in VB.net

I have a 500K+ lines vb.net app, written by 10+ different devs over the past 5 years. Many times it gets the system time and/or date and relies on it. Now I have to re-run real cases thru the program for regression testing purposes, and it screws up cases where the date/time matter. My fix is easy, just replace all the areas in the pro...

Django: Use of DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT in settings.py?

I would like to globally (through my entire site, admin and front-end) adjust the way dates and time are displayed to my likings, but I cannot figure out what is going on with the DATE_FORMAT, DATETIME_FORMAT and TIME_FORMAT variables in settings.py. In this question it says that the settings are ignored. The question is over a year old...

is there a loop controlled by time in c++?

Hi, I am wondering if I can loop x times in one minute interval between each loop. for (int x = 10; x > 0; x--) { cout << "BOOM" << endl; } Is there any way I can print boom every one minute? Or there is a better way to do this? Thank you ...

Timed Based Events for Website

I was wondering if it was possible to make a small script in Jquery that would change an image at a certain time. For my site, I want the image for the opening and closing of a facility to change when it opens and closes. Is this possible with Jquery or should I go with something else? Actionscript/Flash? I can't use PHP on the site......

Measuring elapsed time with the Time module

With the Time module in python is it possible to measure elapsed time? If so, how do I do that? I need to do this so that if the cursor has been in a widget for a certain duration an event happens. ...

Getting the CPU time in JavaScript

Is there a way to get the time a piece of JavaScript actually runs on the CPU, like with the clock() and getrusage() functions in C? Using the normal Date() way only gives the wall time, and for performance measurements the CPU time would be much more useful. Note that I'm not looking for profiling tools, I want to reduce system noise f...

Time of thread vs process in windows?

I need to chose between a process with 2 threads or a 2 processes with one thread on windows. I am intresting in the time slice. Windows running threads so context switch will be in either case. What I want to know if the time it runs each of the thread in the 2 cases will be the same? Thanks. ...

Abort a program after a certain time

I'm trying to develop a test case for a program, and would like to fail the test case if it runs over 4 seconds. How can this be done on linux? (I'm using Ubuntu) I know I can time the execution and fail it time > 4, but that's just a bad approach. Thanks! ...

15min time aggregation in R

Hello I have a zoo series in R. I can choose between a chron or a POSIXct index. How can I aggregate to 15min, taking the last element every 15min? I know how to aggregate daily, writing as.Date, but not how to aggregate every 15min. thanks. ...

Is there a call in vb.net I can make to determine daylight savings time?

Is there a way in VB.Net to determine if the timezone the current system has daylight savings time in effect? Of course I can get the offset from GMT using the "z"/"zz" formatting option, but that doesn't tell me if DST is in effect for the current timezone or if the current timezone is in standard time...or if DST/Standard time aren't ...

Fast Fourier Transform for Noisy Time Series Data

I've got a sample size of 180 data points. Its somewhat of a noisy sine wave. Trying to figure out the period / frequency of the data . Working in Xcode - read over the Accelerate framework but it seems very complex. Any suggestions on how to get the period / frequency of the data ? ...

Changing the timestamp of magic columns (Rails)

I want to change the default timestamp of the magic columns of rails (created_at, modified_at) instead of 2010-09-03 14:52:46 UTC I'd like to change it to September 10, 2010 at 02:52 PM. or at least parse that way. Now, i know that i can do this right in the view, by manipulating the variable, but isnt there a more "railish way" where ...

Calculating if date is in start, future or present in python

I have two date/time strings: start_date = 10/2/2010 8:00:00 end_date = 10/2/2010 8:59:00 I need to write a function to calculate if the event is in the future, in the past or if it is happening right now - I've read a fair bit of documentation but just finding it quite hard to get this to work. I've not really done much time base...

how to make the execution time less(ie. a faster code) for this problem

this question is from Codechef.com [if anyone is still solving this question dont look further into the post before trying yourself] and although it runs right, but i need to make it a lot faster.i am a beginner in c,c++.(i know stuff upto arrays,strings and pointers but not file handling etc).So is there a way to make this program run a...

PHP time() function returning random time shift of an hour

I have some PHP code that inserts a date into a table: INSERT INTO tblEventLog VALUES ... date("Y-m-d H:i:s",time()) ... The results of this are usually correct, but the occasional date is an hour behind: 315070 05-Sep-10 18:08 315069 05-Sep-10 18:07 315068 05-Sep-10 18:07 315067 05-Sep-10 18:06 315066 05-Sep-10 18:06 315065 ...

MySQL / PHP - Time Question

In my DB I stored the time of the last page refresh in a TIME column. I want to compare the last page refresh to the current time now and find out how many 5 minuet periods have passed? I was thinking take the last page refresh and subtract it from the current time then divide by 5. But I don't know about how things are formatted. He...

Classic ASP Function equivalent to PHP's

Uusing PHP and ASP on a project. A form in PHP captures the day, month and year of a birth date. Then it's inserted into a database as the variable currentSeconds. I can get the years from variable $currentSeconds in PHP no problem using the 2nd code snippet 1st Code Snippet $day=$_POST[day]; if ($day<10){ $day="0".$day; } $currentSec...