time

What is the most efficient data structure to store time series of partially changing array?

Hi All, My problem is I have an array of objects of size N. after every time (t+1), some of the values of the array may or may not change. so lets say t+1 index 15 changes but everything else stays the same. What is the most efficient way to store something like this (in memory ) apart from just having an array of arrays of course? I w...

Zend Date giving me zeroes, why?

More problems with dates. Basically I'm trying to populate a table with some datetime values from Zend. The datatype of the column that I'm trying to populate is 'datetime'. However, no matter which constant I try the column is always populated with zeroes. I've tried Zend_Date::ISO_8601, Zend_Date::DATETIME, Zend_Date::now() to no avai...

Automatically populate dates and times

What I am currently doing is setting up a calendar feature, but when the user selects the date, and then the TIME the event starts (ie startTime = 00:10:00am), that it will then pre-populate the second field (ie: endTime = 00:10:30am). So I thought maybe the best route would be when you select your time, jQuery would just select the NEX...

Countdown timer not working correctly

I'm working on a countdown timer for my website, but can't get the script to work. The creator of the script, PHP F1, hasn't been able to help with it. Question is: Why is the year in the target date ($targetDate) variable not making it through to the HTML/JavaScript implement? I'm using the mktime() function. No matter whether I put t...

Figure out type of timestamp

Hi, I've occured a strange time-format, and i can't figure out how to convert it to a readable format. A couple of timestamps from today are 32400683 (this morning) 41891077 56517540 57390993 58728120 (this afternoon) ...

PHP Date/Time and mktime

Hopefully someone can tell me whats going on with this little debugging script. <?PHP // function generates the list of times for function generateTimes($date) { $currentDate = $date; echo "RECEIVED CURRENT DATE: " . date("m/d/Y g:iA", $currentDate) . "<br /><br />"; for($i = 0; $i < 48; $i++) { echo date("g:iA", $currentDat...

Setting Time Format for jspinner in swings

Hi All, I am working in a java swing application. In that application i have to take time input from user. I need to make a JSpinner for the time, only in the hh:mm am/pm format. i searched in properties but could not get this format. Please suggest me some way to display time in hh:mm am/pm format. I thank to all your valuable suggest...

How to change 08:00:00 to 08:00 in PHP/MySql

I have time type in mysql and I input time with format of HH:MM. This is stored in DB as HH:MM:00. Now when I display, it shows seconds as well. I only want to show hour and minutes. In stead of 13:20:00, showing 13:20 etc. What is the best way to do it. I can use substr($time, 0, 5), but I am wondering if there is a better way to d...

Displaying Time in Reporting Services 2008

Hi there I have a table in my report, where I have columns of the datatype Time(7). Now I have problems formatting them correctly in Reporting Services 2008. If I set the format of the expression to HH:mm it does still display 11:12:000 ! I want to get only the hours and minutes! like 11:12 It looks like RS does not knot the format....

how to convert seconds to time format ?

hi there for some reason i convert a time format like : 03:30 to seconds 3*3600 + 30*60 , now .. i wanna convert it back to it's first ( same ) format upthere ... how could that be ? My attempt : 3*3600 + 30*60 = 12600 12600 / 60 = 210 / 60 = 3.5 , floor(3.5) = 3 = hour now .. what about the minutes ?? considering the value can ...

How to store date with HH,MM, AM/PM to MySQL

I was playing around with this http://www.phpform.org/ to create a form. One of form html is the following. I am not sure what kind of type I should use it for HH, MM and AM/PM. Should I use TINYINT with 2 length for HH, MM and VARCHAR with 2 length for AM/PM? Should I have separate field for each? ... ... <li id="li_1" > <l...

How to calculate "time ago" in Java?

In Ruby on Rails, there is a feature that allows you to take any Date and print out how "long ago" it was. For example: 8 minutes ago 8 hours ago 8 days ago 8 months ago 8 years ago Is there an easy way to do this in Java? ...

Subtract two time values in ms sql server 2008

Hai all, How to subtract two time values in sql server 2008.I am using time variables in stored procedure. please help ...

mapping location to a time zone

I need to get the time zone for a given address/location. Assume that the address/location can be reverse geocoded (using google) to a lat/lng if necessary. This means that I may not have a zip code. I was really hoping that google provided some kind of API for this, but it seems that they don't. At a minimum you can google search fo...

Converting string to time

Hi, I have string like this:"0:385" (first number is seconds, next numbers are milliseconds), I want to use in datagridview with sorting like numbers (not like strings) so I am trying to make DateTime from string but I am not sure how exactly do this. I know I should use method Parse (or ParseExact) but when I tried it it says "String wa...

postback times are the same no matter what is happening

I found this by accident and feel that it must be a settings issue. I was initially trying to solve a problem with uploading large files. In the process of implementing a solution I was able to get the file uploaded in approximately 2 minutes whereas before it would timeout after a much longer time period. The strange thing is this: the ...

What is the best way to do time stamping?

Okay so I would like to do some time stamping down to uS ... mS would be okay too ... but in looking into this, I am thinking What are the BEST PRACTICES when doing time stamping? My assumptions in this case are that C/C++ code is being used. I know internal clocks have various resolutions and the like ... but I am interested in things t...

time format in SQL Server

Does anyone know how can I format a select statement datetime value to only display time in SQL Server? example: Table cuatomer id name datetime 1 Alvin 2010-10-15 15:12:54:00 2 Ken 2010-10-08 09:23:56:00 When I select the table I like the result will display as below id name time 1 Alvin 3:12PM 2 Ken ...

php - adjusting for timezones

Alright so I have this code which makes a list of dates: $dates = array(); for($i = 1; $i < 10; $i++) { $datetime = mktime(12, 0, 0, date('n'), date('j') + $i, date('Y')); if(date('N', $datetime) != 6 && date('N', $datetime) != 7) { ...

What is the best time tracking software and why?

Hi, I'm working in a company where we have to report our time daily. We have to said what type of task we were doing during the day. Do you know some software which could help us to make such daily summary for me? Maybe there is automatic tool which can monitor the time which I'm spending in each application? i mean something like res...