time

Manipulating Dates in PHP without using Regular Expressions

Is there a way to change a date from 1985-12-15 to 1985-12 without using a regular Expression? ...

Retrieve rows grouped by hour with MySQL

I have a table containing access logs. I want to know how many accesses to resource_id '123' occured in each hour in a 24 hour day. My first thought for retrieving this info is just looping through each hour and querying the table in each loop with something like... and time like '$hour:%', given that the time field holds data in the f...

Adding time in PHP

I am pulling a datetime from a mysql db and i would like to add X hours to it then compare it to the current time. So far i got $dateNow = strtotime(date('Y-m-d H:i:s')); $dbTime = strtotime($row[0]); then i tried $dbTime + strtotime("4 hours"); but 4 hours seem to add 4hrs to the current time instead of raw 4hours. How do i add X ho...

activity in past hour

I am trying to work out if users have had activity in the past hour. The following is my code, but it always returns yes, no matter what: $houraway = (int)mktime() + (60 * 60); $now = mktime(); while($user = mysql_fetch_array($qusers)) { echo $user['Name']." - "; $datetime = explode(" ", $user['Custom6']); $date = $dateti...

How to time a script in DOS?

How do you time a script in the DOS prompt? The *NIX equivanlent would be: $ time myscript real 0m0.886s user 0m0.846s sys 0m0.031s $ Is there a DOS equivalent to this? Thanks ...

C Programming. Calculate Elapsed Time in Milliseconds (UNIX)

I want to calculate the time in milliseconds taken by the execution of some part of my program. I've been looking online, but there's not much info on this topic. Any of you know how to do this? ...

What is AM/PM called?

Hi All, Thanks for reading. I know what AM/PM stand for (ante-meridiem and post-meridiem), but what are they called? For example, if I am building a date/time from some fields, such as date, hour, minute, am/pm, and want the user to be able to select the time from some select menus like 1-12, 00-60, and am/pm, I would name the selects...

UNIX System time and User time. C-Programming

Hi I'm trying to get the system time and the user time that are consumed by a program. I'm having some trouble though as my times are always zero in milliseconds. I think I'm doing something wrong. Can you guide me in the right direction ? Both of my methods return 0 typedef struct{ struct timeval ru_utime; /* user time used */ ...

VBA - show clock time with accuracy of less than a second

Is there a way to use VBA (excel) to generate a clock time with accuracy to a tenth of a second or less? eg: Sub test() MsgBox Format(Time, "hh:mm:ss???") 'not sure what this format should be... End Sub ...

MySQL to return only last date / time record

We have a database that stores vehicle's gps position, date, time, vehicle identification, lat, long, speed, etc., every minute. The following select pulls each vehicle position and info, but the problem is that returns the first record, and I need the last record (current position), based on date (datagps.Fecha) and time (datagps.Hora)...

Time things with Javascript

How can i time how much time passes between 2 events with javascript? like, to the millisecond? ...

Convert Difference between 2 times into Milliseconds?

I have two masked TextBox controls and was wondering how I'd go about getting the time in each one and then converting the difference into milliseconds. Like, say in tb1 I write "12:01" and in tb2 I write "12:02", and then click a button. Once the button's clicked it starts a timer and at 12:02 a messagebox will be displayed. I know how ...

Alarm clock application in .Net

I'm not really writing an alarm clock application, but it will help to illustrate my question. Let's say that I have a method in my application, and I want this method to be called every hour on the hour (e.g. at 7:00 PM, 8:00 PM, 9:00 PM etc.). I could create a Timer and set its Interval to 3600000, but eventually this would drift out...

What is a javascript regular expression for matching time in military (24 hour) format?

I would like a javascript regular expression that will match time using the 24 hour clock, where the time is given with or without the colon. For example, I would like to match time in the following formats: "0800", "23:45", "2345" but that would not match invalid times such as "34:68" or "5672" ...

C++ windows time

Hello, I have a problem in using time. I want to use and get microseconds on windows using C++. I can't find the way. Thnaks ...

SSAS 2008 Dimension Wizard and the Date Template

Hi! Does anyone know how to use the Date Template with the BIDS 2008, SSAS Project, Dimension Wizard? I keep getting an error - rightly so, I suppose - "Dimension not generated because it is bound to a time binding" (after having selected Generate a non-time table in the data source, in order to get to the Date template). I am trying t...

Cleanest and most Pythonic way to get tomorrow's date?

What is the cleanest and most Pythonic way to get tomorrow's date? There must be a better way than to add one to the day, handle days at the end of the month, etc. ...

How can I update the Date and Time control panel to match the W32Time service configuration?

I have a client/server application for which it is beneficial to have the PC clocks on the client and server synchronized. I want my setup program to offer an option to configure the W32Time service automatically. I have found sufficient documentation to configure the service's registry entries (principally here), and I have confirmed ...

How do I find the time interval between two date attributes in an Entity in a Cocoa Application using Core Data?

I have a date attribute "off" which is represented with Date Formatter in a tableView as HH:MM. I have a date attribute "on" that is also represented with a Date Formatter in a TableView. I'm trying to output the time interval (HH:MM)between these two attributes. The output would be flight time. ...

Reducing calculation time for derivative blocks in SimMechanics

I have a program in SimMechanics that uses 6 derivative blocks (du/dt). It takes about 24 hours to do 10 secs of simulation. Is there any way to reduce the calculation time of the Simulink derivative blocks? ...