Storing times in Python - Best format?
When storing a time in Python (in my case in ZODB, but applies to any DB), what format (epoch, datetime etc) do you use and why? ...
When storing a time in Python (in my case in ZODB, but applies to any DB), what format (epoch, datetime etc) do you use and why? ...
Why does: DateTime.Now.ToString("M") not return the month number? Instead it returns the full month name with the day on it. Apparently, this is because "M" is also a standard code for the MonthDayPattern. I don't want this...I want to get the month number using "M". Is there a way to turn this off? ...
example: $date = 'Wed, 18 Feb 2009 16:03:52 GMT'; //How can I get $date to equal the current time in the same format? ...
I'm looking for a better than O(n) algorithm to determine if a date in the future will have daylight savings time applied (and how much). Given a year, month, day, hour, minute and time zone (and a copy of the Olsen Time Zone database) how does one efficiently determine if that date will be in DST? I'm looking for the algorithm, not a ...
I've been storing all dates in the database as UTC time for several years now, but recently, it's becoming more of a pain to deal with date range queries in reporting services where the date range is specified in local time. Specifically, let's take this example data set: EmailAddress DateCreated [email protected]...
Hi, As i am working on a reminder application, i need to show the reminder dialog whenever the set date has arrived for a particular data. I am using the following code to store the date. long now = System.currentTimeMillis(); DateField dateField = new DateField("",now,DateField.DATE); long date = dateField.getDate(); For example,...
Hi, My current code looks like this: DateTime dateBegin = DateTime.ParseExact(begin, "MM/dd/yyyy", null); DateTime dateEnd = DateTime.ParseExact(end, "MM/dd/yyyy", null); But it throws an exception whenever the date in "end" is different. I get the dates from a DateTimePicker control, thus the date may look like "1/12...
To my disappointment I noticed that there is no real timespan object, if you get a timespan, and do a .years or .months you'll get nothing, you'll only get .days and lower because a timeSpan object doesn't carry anything to tell it which month or year the timeSpan was created on. Ttherefore it'll never really know how many months it's be...
In MySQL, let's say I have a table with a column called 'actionTime' declared as a 'datetime' (YYYY-MM-DD HH:MM:SS). Is there an easy way to use "GROUP BY actionTime" but only use the 'date' part of the 'datetime'? Thanks ...
I need to join my data table to a server calendar file (has set fiscal dates, periods, etc.). I don't get any results and believe it is because my table has date/time like "11/23/2009 11:30:34AM" and the calendar file only has date/time like "11/23/2009", so the fields are not identical. current SQL reads like: From tbl_data Inner Join...
Hi Friends, I am facing an issue in my Flex application. I am creating some array collections and storing date objects in it.In the later part of the application I will create 'advanceddatagridcolumns' with these array collections as the data sources. Initially while creating the Array Col , I do have the 'formats' given by user, for ea...
I want to discretize the DateTime with the resolution of 5 minutes. I did it in C#, but how to convert the following code to MySQL? DateTime Floor(DateTime dateTime, TimeSpan resolution) { return new DateTime ( timeSpan.Ticks * (long) Math.Floor ( ((double)dateTime.Ti...
How can I get the total number of seconds since '1970-01-01 00:00:01' from a DateTime instance in MySQL? ...
Possible Duplicate: Create a date with T-SQL Hi, I've a data table that stores each year, month and day value as ints: year | month | day 2009 | 1 | 1 2008 | 12 | 2 2007 | 5 | 5 I need to convert it to datetime value, because I need to use it in a datetime between operation. How could I do this? Thanks, b. ...
SELECT [NEXT_UPDATE_TIME] FROM [BGREX_UpdateQueue] WHERE [NEXT_UPDATE_TIME] < 18/12/2009 I want to select those dates from the records where datetime value in column is less than some datetime, we need to compare. I have several value lass than "18/12/2009", but getting no rows returned. following syntax does not work either SELEC...
How can we update datetime value in a column using sql say, if we want to update any of datetime values by adding an hour or 5 minutes etc. UPDATE TableLastCalls SET [NEXT_UPDATE_TIME] = ?? // want to add an hour ...
How do I convert a datetime to just a date in SSIS? I'm trying to perform an aggregate query which will group by a particular date. In order to do that, I'm trying to extract just the date portion of the timestamp(stored as a datetime) so I can perform the GROUP BY on the next step. I've looked at the DATEPART function, but it looks l...
I had never worked with the datetime module in Python 2.3, and I have a very silly problem. I need to read a date in the format '10-JUL-2010' then subtract a day (I would use timedelta), and return the string '09-JUL-2010 00:00:00 ET' of course, this is for hundreds of dates. While it should be trivial, I cannot find the info on ...
Hi, i am trying to understand how DateTime.ToString(Date pattern) work in .net framework, C#. I changed my computer to have a short Date format like this yyyy.MM.dd. Following is what I notice DateTime myDate = DateTime.Now; myDate.ToString("yyyy/MM/dd") always return in the format of yyyy.MM.dd not yyyy/MM/dd and myDate.ToString("...
I have a website that was launched a few months ago. I would like to write some code that will look through every month, since launch, and grab metrics for that month. My question is: What is the best way to specify a start date, and then iterate by month, all the way up until the current month (or to another specified date). Does any...