datetime

SQL Server 2005 Express cannot update datetime field when windows is set to Italian

Hi, I am struggling with an MS SQL 2005 Express issue. A query like the one below works perfect when Windows Regional Options (control panel) is set to English (United States), but it fails when set to Italian (and maybe other languages). UPDATE MyTable SET StartDate='2009-07-14 12:05:30' WHERE ID=7 I tried also many different date-t...

MKTime Function Returning Wrong Time?

Hi guys, I'm having a bit of trouble with the mktime function. On my production server, if I execute the following: echo '<p>' . mktime(24, 0,0, 8,29,2009) . ' - 12pm</p>'; echo '<p>' . mktime(23, 0,0, 8,29,2009) . ' - 11pm</p>'; echo '<p>' . mktime(22, 0,0, 8,29,2009) . ' - 10pm</p>'; And then convert those timestamps back to readabl...

how to render a user the local-time using a UTC Time (asp.net & ajax)

Hi, I've an issue while my data persisted as utc date-time and I want my users see the right time (thier) local time. I can do this using javascript that sends the local time from the client machine to server, but this will cause me the first time the page will be seen it will be written using the UTC-Time. do you have more ways? than...

MySQL query to get non-data for unassigned dates

I have a table with weekly data that looks like: userID Site date ------ ------ ------ Smith Ferris Wheel 2009-07-13 Jones Outerspaceland 2009-07-13 LChar Ferris Wheel 2009-07-14 Smith Underworld 2009-07-16 Jones Fish Bowl 2009-07-17 Munson Go-Go Tech ...

Need only Date from DateTime

Hi I have a variable of DateTime type in SQL. Just need to have Date part of it. please Help? ...

Problem with Date in Oracle using JDBC

I've the following scenario: Two computer: First computer running under Windows Vista, second computer running under Linux, connecting both to Oracle 10g. Oracle 10g is running in the second computer. I've have done one test program in Java that conecting to Oracle using ojdbc14.jar This test program is only connecting to database, re...

Mysql Query - Query to show Itens that are from Actual date to the Max of 15 days ago

Hello This is a bit "confused" question for those who don't now advanced SQL... However. I want your help to do a query. Its simple but I'm not sure how to do it. I want the query to do something like this. I want her to SELECT * FROM table1 WHERE date.... The date condition its only to show items that have a date to the MAX of 15...

How do I format hours in DateTime to return 0 instead of 12?

By default, the hour in a format string for a DateTime transforms 0 into 12. For example, if you have DateTime dt = new DateTime(1999, 1, 1, 0, 0, 0); string s = dt.ToString("h:mm:ss"); the value of s will be "12:0:0", not "0:0:0". Is there a way to get "0:00:00" instead? ...

SQL query: time difference

Hi all, This is going to seem like a lame question for all experts in SQL server views but... So I have a small set of data that my client needs for reporting purposes. I have to admit that although I did ask them their reporting requirements, it isn't till now that I see that my db could be better optimised. One of the pieces of data...

DateTime in python extracting different bits an pieces

Ok this should very easy task right. Well for some reason its becoming hell to me. I want to extract Year from current date using python. Do something like DateTime a = DateTime.Now() a.Year (this is in C#) Thanks ...

How accurate is python's time.sleep()?

I can give it floating point numbers, such as time.sleep(0.5) but how accurate is it? If i give it time.sleep(0.05) will it really sleep about 50 ms? ...

SQL Server convert string to datetime

This is not asking how to convert an arbitrary string to datetime in MSSQL such as this question. I can control the string format but I want to know what the MSSQL syntax is for updating a datetime field using a date string. ...

Inserting a python datetime.datetime object into mysql

I have a date column in a mysql table. I want to insert a datetime.datetime() object into this column. What should i be using in the execute statement? I have tried: now = datetime.datetime(2009,5,5) cursor.execute("INSERT INTO table (name, id, datecolumn) VALUES (%s, %s , %s)",("name", 4,now)) I am getting an error as: "TypeError: n...

How to get the value of a datetime_select field with javascript in ruby on rails

Hi, I had a previous question that touched this topic (http://stackoverflow.com/questions/1131694/rails-how-to-get-value-from-another-field-when-executing-an-onchange-remote-func), but then I dugg a little deeper and realized that my problem is the datetime_select method. I have a textfield with onchange. In the onchange I need to get ...

Language to express complex time multi-intervals?

I'm wondering if anyone knows of any declarative language to express absolute date-time multi-intervals. I mean sets which are the union/intersection/complement of time intervals. Intervals I would like to represent are like: ( (from the second day of the month to the 10th) intersection (months 1,2,3,10) ) union ( (from the second ...

Get Date from Date Time Picker

How do I get only the Date from a DateTime Picker in C#? ...

C#: Convert AS/400 date into DateTime

Dates in DB2 AS/400 are an integer, containing the number of days since sometime around the turn of the 20th century. Question 1: Does anyone know the IBM DB2/AS400 "zero" date? e.g.: 12/30/1899 12/31/1899 1/1/1900 Question 2: Given an "AS/400" date (e.g. 40010) how can you convert that to a CLR DateTime? DateTime d = new DateTime(...

Routine to check if a given date is summertime or wintertime

Do you know if an API exists for that checking? ...

DateTime of next 3am occurrence

I'm sure this is very easy, but I've got a sudden mental block.... I'm trying to get a DateTime object for the next occurence of 3am... for example, if DateTime.Now is 16/july/2009 : 12:04pm - the next occurance of 3am would be 17/july/2009 : 03:00 However, if DateTime.Now was 17/july/2009 : 01:00 then the next occurence would still be ...

What is the internal representation of datetime in sql server?

What is the underlying datastructure of datetime values stored in SQL Server (2000 and 2005 if different)? Ie down to the byte representation? Presumably the default representation you get when you select a datetime column is a culture specific value / subject to change. That is, some underlying structure that we don't see is getting ...