time

Add 13 hours to a timestamp

I have a table with timestamp values like: 2009-07-14 02:00:00 I need to display them at run time with 13 hours added, like: 2009-07-14 15:00:00 What's the simplest way to do this in PHP? ...

Is there ever a good reason to store time not in UTC?

I am wondering if there are any good reasons to ever store time information in anything other that UTC (GMT)? I believe that this is a solid rule for all software engineering. The conversion to local time is merely a translation that happens at the UI layer for display purposes. I have also seen cases where the translatation is needed in...

Where can I find a time range widget in Javascript/jQuery?

Hi, I'm looking for some sort of TimeRange widget in Javascript/CSS/jQuery. I'm not looking for a time/date picker, which are widely available. I need it for a website to allow businesses to select their openinghours by clicking and hovering over the hours they're open. +-----------------------------+ | 0h 0h15m 0h30m ... 23:45 | ...

SQL query: time difference

Hi all, This is going to seem like a lame question for all experts in SQL server views but... So I have a small set of data that my client needs for reporting purposes. I have to admit that although I did ask them their reporting requirements, it isn't till now that I see that my db could be better optimised. One of the pieces of data...

How do I work with Time in Rails?

I've been pulling my hair out trying to work with Time in Rails. Basically I need to set all time output (core as well as ActiveSupport) to the server's local time -- no GMT, no UTC, etc. I've seen various posts relating to Time, but they usually involve someone's need to set it for each user. Mine isn't nearly as complex, I simply wa...

How accurate is python's time.sleep()?

I can give it floating point numbers, such as time.sleep(0.5) but how accurate is it? If i give it time.sleep(0.05) will it really sleep about 50 ms? ...

DateTime in C#

How would I display the current time that could be either in 24 hour format or am/pm format depending on windows setting in C#? ...

Time based php script

Say I want a php script the run the function itstime() every hour. Other than setting up a cron job on the server how can I do this? Or is this not possible because php scripts need to be opened to be ran? Thanks. EDIT: I want to write some information to a log file and depending on some variables send it in an email. ...

Adding java time objects

How do you say, add 1 hour to a given result from calendar.getTime? ...

Ruby: how do I calculate a duration given 2 datetimes from a CSV file?

I have a number of CSV files which contain start and finish times. I can use FasterCSV to parse the files, but I don't know the best way to get the duration in Ruby. Here are the values in my hash generated for each row of the CSV files. start time: Mon Jul 20 18:25:17 -0400 2009 end time: Mon Jul 20 18:49:43 -0400 2009 ...

How to stop a process with time constraints

I think the topic might not be accurate enough, but I really don't know how to describe it in a very brief way... What I want to do is as follows: I have a process running some analysis (in Java) and trying to give a return value, but the whole analysis has a time constraint, say 10 seconds If the analysis gives a result within 10s, ...

Automatically timing every executed command and show in Bash prompt?

I often happen to forget to explicitly prefix executions with the "time" command, ideally I would see in the next shell prompt how much real time the last command took (on every command). I already scoured through the bash documentation, but couldn't find anything related. ...

Changing HTML content dynamically with JS before ActiveX component has finished loading

I have an HTML page, which performs the following actions (in order): Shows static HTML content Replaces some of the static content using JavaScript Loads an ActiveX component using JavaScript The problem is that step 2 is always executed after step 3, even though the code to display the ActiveX component is after step 2 (and loading...

Limit execution time of an function or command PHP

Hi is there a possibility to set time limit only to a command or only to a function eg: function doSomething() { //..code here.. function1(); //.. some code here.. } I want to set time limit only to function1. There exits set_time_limit but I think this sets the time limit to whole script. Anybody any Idea? ...

Time query for sql database using Visual Basic

I want to display max time and min time for a day in grid control using visual basic from sql database. table column are:- UserID,UserName,Date,Time 1 Shanks 30/1/2009 10:11:22 1 Shanks 30/1/2009 10:15:22 1 Shanks 30/1/2009 12:15:22 1 Shanks 30/1/2009 13:15:22 output must be in grid 1 Shanks 30/1/2009 10:11:22 13:15:22 ...

Programmatically compute the start time of a process on Windows

Hi, I'm writing c/c++ code on Windows using Visual Studio. I want to know how to calculate the start time of my process effectively. Can I just use gettimeofday()? I've found the following code from google but I don't understand what it's doing really : int gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; uns...

Is there a good reason to make time estimates for features that are months out?

I was in a meeting today with a consultant (consulting us on internal procedures) and we went through an exercise of planning out the next three months of development. I'm not opposed at all to doing this, I think it is essential to have an understanding of what is coming next, in what order, and their relative magnitudes. I also think i...

How do you match 12 hour time hh:mm in a regex?

How could you match 12 hour time in a regex-- in other words match 12:30 but not 14:74? Thanks! ...

in c++ how can I find the maximum system date?

I'm trying to find the maximum allowed system date in cpp, but I can't find the function to do that... Can anyone help me? ...

Change the date of wordpress

Hi, wondering how I change the date wordpress thinks today is.. where does it pull the time and day from and is it possible to change that to say 2010 instead of 09 ...