datetime

"Dynamic" localized display of custom DateTimePicker format

I have a Winform application with 2 DateTimePicker's on it, initialized as follows: private void InitializeComponent() { ... this._StartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; .... // Note: I use a custom format, because I don't want to display seconds this._StartTime.CustomFormat = System.Globalization.DateT...

Converting human readable date into integer values

Hello all, I am looking to do something really simple. Merely convert a string, such as 'december' into something I can use with MySQL (such as '12'). At the moment I use a dict, month_map = { 'december': '12', 'november': '11', 'october': '10', 'september': '09', 'august': '08', 'july': '07', 'june': '06',...

Adding relative week number column to MySQl results

I have a table with 3 columns: user, value, and date. The main query returns the values for a specific user based on a date range: SELECT date, value FROM values WHERE user = '$user' AND date BETWEEN $start AND $end What I would like is for the results to also have a column indicating the week number relative to the date range. So if ...

Informix: datetime manipulation

I have 2 fields in a table test1: onlydate DATE onlytime DATETIME HOUR TO MINUTE and 1 field in a table test2: dateandtime DATETIME YEAR TO SECOND Now I need to append the value of onlydate and onlytime field and set it to dateandtime field. How do I do that? ...

Incorrect error

If you assign an invalid date (like December 39th) to a datetime column ActiveRecord returns a "can't be blank" error when is should probably return an error like "Not a valid date" My question. Is this expected rails behavior, a bug or, something that I could patch? class ExerciseLog < ActiveRecord::Base validates_presence_of :sche...

How to convert DATETIME to FILETIME value in T-SQL?

I need to convert a SQL Server DATETIME value to FILETIME in a T-SQL SELECT statement (on SQL Server 2000). Is there a built-in function to do this? If not, can someone help me figure out how to implement this conversion routine as a UDF (or just plain Transact-SQL)? Here is what I know: FILETIME is 64-bit value representing the numbe...

Get "2:35pm" instead of "02:35PM" from Python date/time?

I'm still a bit slow with Python, so I haven't got this figured out beyond what's obviously in the docs, etc. I've worked with Django a bit, where they've added some datetime formatting options via template tags, but in regular python code how can I get the 12-hour hour without a leading zero? Is there a straightforward way to do thi...

Implementation code for GetDateFormat Win32 function

I am porting some legacy code from windows to Linux (Ubuntu Karmic to be precise). I have come across a Win32 function GetDateFormat(). The statements I need to port over are called like this: GetDateFormat(LOCALE_USER_DEFAULT, 0, &datetime, "MMMM", 'January', 31); OR GetDateFormat(LOCALE_USER_DEFAULT, 0, &datetime, "MMMM", 'May', 3...

Is this sql where statement correct?

I have 10 rows for today's date but my select statement based on date dosen't seem to work.... SELECT Id,WirelessId,RegNo,DriverName1,MobileNo1,DriverName2,MobileNo1 from DailySchedule where IsDeleted=0 and CreatedDate='2010-05-28' Any suggestion... ...

Insert date and time into Mysql

Hi..guys I am trying to insert date and time into mysql datetime field. When a user select a date and time, it will generate two POST variables. I have searched internet but still not sure how to do it. My code. //date value is 05/25/2010 //time value is 10:00 $date=$_POST['date']; $time=$_POST['time']; $datetime=$date.$time If...

Filter objects within two seconds of one another using SQLAlchemy

Hello: I have two tables with a column 'date'. One holds (name, date) and the other holds (date, p1, p2). Given a name, I want to use the date in table 1 to query p1 and p2 from table two; the match should happen if date in table one is within two seconds of date in table two. How can you accomplish this using SQLAlchemy? I've tried (u...

Is this a bug in plist or Xcode?

G'day All If you create a date item in the plist editor of Xcode or Apple's standalone plist editor you get something of the form <date>2010-05-29T10:30:00Z</date> which is a nice well formed ISO date at UTC (indicated by the "Z"). Because I'm in timezone UTC +10 when that's read into my app & then displayed I get 8:30 PM out, still goo...

Unable to convert MySQL date/time value to System.DateTime

Hello I am using ibatis and C#. i get a result from a select query that has CreatedDate as one of the field. The Datatype of CreatedDate in Mysql is Date. I assign the result set of the select query to a Ilist< DeliveryClass>. Here the DeliveryClass CreatedDate as DateTime. When i run the application, i get Unable to convert MySQL da...

how to convert from timestamp to data in QT ?

hello all i have unix timestamp and i need to convert it to Human readable data + time how can it be done in QT ? ...

Javascript timezone solution needed(taking into account the actual difference in UTC timestamps)

I have unix timestamps from time zone X which is not known, the current timestamp(now()) in TZ X is known 1275143019, how to approach a javascript function so that it can generate the datetime in the users current TZ in the format 2010-05-29 15:32:35 ? UPDATE I'm not a unix timestamp expert,if unix timestamp is always the same in dif...

reverse this function

i have code that takes a csharp datetime and converts it into a long to plot in the "flot" graph. here is the code public static long GetJavascriptTimestamp(DateTime input) { TimeSpan span = new TimeSpan(DateTime.Parse("1/1/1970").Ticks); DateTime time = input.Subtract(span); return (long)(time.Ticks / 1...

sql server convert string to datetime

Hello, I have this string: '30/05/2010', and I would like to enter it to a smallDatetime field. In the database it should look something like this 2010-05-30 15:33:25 Any Idea how? TY ...

how to format jsf 2.0 <f:selectItems/> with date value from List

Hi, Im using jsf 2.0 to develop app where user has to select (using radio button) a date from the list of possible choices. List of dates is a managed bean property of type List< java.util.Date>. Im using facelets <h:selectOneRadio value="#{banner_backing.selectedInterval}" border="1" layout="pageDirection"> <f:selectItems val...

How to control Time zone formatting in System.Xml.Serialization or during application execution?

I'm developing a C# .Net Application that is executing on a system located in the Central Time Zone. The application gets information from a third party using an API they provide. I have used the WSDL to produce the code that my application access the API with...their reporting API allows you to define a start date and end date for the r...

How Do You Databind Avalon DateTimePicker Start Value?

Trying to set the start time of the Avalon DateTimePicker, but all I get is the current time. Anyone had any success with this control. FYI, I am stuck using .Net 3.0. <wf:DateTimePicker x:Name="DatePickerStartTime" DateTimeSelected="{Binding Path=StartTime,Mode=TwoWay}" > ...