datetime

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...

MySql 'Order by Date' Question

Im pulling data from a MySql data table. I'm pulling from a row called 'PubDate' (meaning Published date). This format is in Date format, not DateTime. When I execute the query Select * from Articles order by pubDate ASC Its ordered by date as so: 1.09/18/09 2.09/18/09 3.09/19/09 4.09/20/09 If possible I would like to be able to...

MySQL datetime operation

How to get the datetime value several days/weeks/months/years later in MySQL? I just know the current datetime is NOW() . ...

jExcelApi - cell date format reusing doesn't work.

I created a wrapper to jExcelApi classes to easily export lists of objects to Excel. To minimize object creation cell formats are created as static fields and reused in consecutive calls to export. But I have problems with Date format - the first call works good, but in all consecutive exports date cells have numeric format instead of da...

No milliseconds value when reading DateTime values from a SQL database in C#

I have high precision dates stored in an SQL server, e.g. 2009-09-15 19:43:43.910 However when I convert that value into a DateTime the miliseconds value of the resulting DateTime value is 0: reader["Timestamp"] = 15/09/2009 19:43:43.000 Having these DateTime values in precision down to milliseconds is very important to me - what i...

.NET date handling: parse 15-OCT-08 15.36.16.280000000

The custom date strings in .NET allow you to parse a date with seven fractional parts of a second using fffffff I need to parse data exported from Oracle SQL Developer which looks like: 15-OCT-08 15.36.16.280000000 I count nine fractional parts but fffffffff is not a valid date format. In fact: ? DateTime.Now.ToString("dd-MMM-yy H...

Problem with Sql Server query using BETWEEN in where with DATETIME

I have a Stored Procedure that loops through the months in the fiscal year and does a count for the items in each month. I know for a fact there are 176 items, but when I run this it returns a total count of 182. I tried removing one second from @EndDate, but then my total count was 165. So I'm either counting items twice, or not coun...

Rails app - how to enter events in local time zone

I am working on a Rails app that displays a sports schedule (in a basic table). Each game/event is a db table row. The customer wants all the events to display in chronological order but to also display the time in the event's local timezone. How can I add a timezone selector to the New action? So that when the customer enters events...

How do you determine a processing time in Python?

I'm new to Python, and confused by the date/time documentation. I want to compute the time that it takes to perform a computation. In java, I would write: long timeBefore = System.currentTimeMillis(); doStuff(); long timeAfter = System.currentTimeMillis(); elapsed time = timeAfter - timeBefore; I'm sure it's even easier in Python. C...

How do ruby on rails multi parameter attributes *really* work (datetime_select)

I believe that datetime_select is black magic. What I'm really trying to figure out is the whole 1i,2i,3i,4i... multiple parameters stuff. Specifically how is it handled in the back end (activerecord, something else?). What's with the 'i' after the order-number? Is it a type-specifier? If so what are other types that are available? I...

Human readable and parsable date format in Java.

I want to save a Date object to a readable string (for example 22/10/2009 21:13:14) that is also parsable back to a Date object. I have tried many things and the best I could find was to use DateFormater for parsing and formating but it has a setback. When you format a date you lose seconds information. I tried to find if there is an op...

Filling in missing dates using a linq group by date query

I have a Linq query that basically counts how many entries were created on a particular day, which is done by grouping by year, month, day. The problem is that because some days won't have any entries I need to back fill those missing "calendar days" with an entry of 0 count. My guess is that this can probably be done with a Union or so...

How to cast DATETIME as a DATE in mysql?

My query is this. I have a bunch of entries and i want to group them by date. But instead of having date in my database, I have a datetime field. What do I do? select * from follow_queue group by follow_date cast follow_date as date That's not working. Thanks! ...

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...

ASP.NET DateTime Picker

Hi guys, is there any good free/open source time picker control that goes well with ASP.NET Calendar control ? thanks in advance ...

SAS informat datetime milliseconds

Can SAS store and use datetimes that contain fractions of less than 1/10th of a second? eg: data _null_; input @1 from_dt:datetime22.; put from_dt= ; cards; 24Sep2009:11:21:19.856 ; run; ...

Is it possible to change the base millisecond refrence time 1970 to 2008 in java (like JSR-310)

I want to be able to change the base millisecond reference from 1970 to 2008 in java so that I can save space in the database and unique Ids. Preferably with Joda-Time. The upcoming jsr-310 in the supposed java 7 release implements it. In the The Discrete Timeline section of this link it states that the counting of milliseconds has ch...

How do I parse an HTTP date-string in Python?

Is there an easy way to parse HTTP date-strings in Python? According to the standard, there are several ways to format HTTP date strings; the method should be able to handle this. In other words, I want to convert a string like "Wed, 23 Sep 2009 22:15:29 GMT" to a python time-structure. ...

Parsing impossible dates in C#

Is there an elegant way to be permissive in date input in C# to accommodate user input like '2009-09-31' (e.g. September 31, which doesn't exist and causes DateTime.Parse to choke)? Ideally I would like to parse this as October 1 (e.g. latest possible date plus overflow). ...

Is it possible to measure a timespan that could span over several machine restarts not using the DateTime class???

Hi, I have a bit of a strange problem. I'd like to be able to measure a timespan independently of the system datetime. We basically have a system with one central server and multiple local servers which are constantly synchronising with the central server. Objects on the central server are only valid for a specified time period, e.g....