datetime

how to take the year using date stored in DataBase:

how to take the year using date stored in DataBase: in Sql query ?? ???? eg date stored as 2010-04-29 15:53:09.577 how to get the year in stored procedure to check whether the year i pass and the year stored in database are same ...

QSqlQuery UPDATE/INSERT DateTime with server's time (eg CURRENT_TIMESTAMP)

I am using QSqlQuery to insert data into a MySQL database. Currently all I care about is getting this to work with MySQL, but ideally I'd like to keep this as platform-independent as possible. What I'm after, in the context of MySQL, is to end up with code that effectively executes something like the following query: UPDATE table SET ...

How is timezone handled in the lifecycle of an ADO.NET + SQL Server DateTime column?

Using SQL Server 2008. This is a really junior question and I could really use some elaborate information, but the information on Google seems to dance around the topic quite a bit and it would be nice if there was some detailed elaboration on how this works... Let's say I have a datetime column and in ADO.NET I set it to DateTime.UtcNo...

SQL Convert Nvarchar(255) to DateTime problem

I'm using SQL server 2008. I have 2 Tables: Table 1 and Table 2. Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null Example data in Table 1: 26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03 When i try CAST(OldDate as datetime) I get this error: ...

MySQL: Records inserted by hour, for the last 24 hours

I'm trying to list the number of records per hour inserted into a database for the last 24 hours. Each row displays the records inserted that hour, as well as how many hours ago it was. Here's my query now: SELECT COUNT(*), FLOOR( TIME_TO_SEC( TIMEDIFF( NOW(), time)) / 3600 ) FROM `records` WHERE time > DATE_SUB(NOW(), INTERVAL 24 HOU...

WPF4 DatePicker - adding time

Now that there is an official MS DatePicker in WPF4, I was wondering if there was a way to let it edit the Time part of a DateTime as well. I can't see anything, but it seems rather obvious to have missed out? ...

Syncing objects between two devices with different system times

Hi there. I'm syncing objects between two devices. Objects have a lastModified property. If both devices have modified an object, then during the next sync the version of the object with the most recent lastModified is chosen on both devices. So we don't do fine-grained merging, only 'most recent version' merging. The problem is this. W...

python date difference in minutes

How to calculate the difference in time in minutes for the following timestamp in python 2010-01-01 17:31:22 2010-01-03 17:31:22 ...

varchar data type to datetime data type resulted in an out-of-range??

Very weird problem occurred, I have moved a site from one server to another - All is working, but any query involving a date is playing up. I get the following: DELETE FROM MYTABLE WHERE categoryId = -2 AND datecreated < '3/23/2010'; The conversion of a varchar data type to a datetime data type resulted in an out-of-range value Now ...

Python Split usage

I'm cocking this up and it should be really simple but the value of sortdate is none (note im only doing this because converting a string to a date in Python is a bugger). DateToPass = str(self.request.get('startdate')) mybreak.startdate = DateToPass faf = DateToPass.split('-') sortdate = str(faf[2] + faf[1] + faf[0]) That should work...

mySQL query : working with INTERVAL and CURDATE

Hello, i'm building a chart and i want to recieve data for each months Here's my first request which is working : SELECT s.GSP_nom AS nom, timestamp, AVG( v.vote + v.prix ) /2 AS avg FROM votes_serveur AS v INNER JOIN serveur AS s ON v.idServ = s.idServ WHERE s.valide =1 AND v.date > CURDATE() -30 GROUP BY s.GSP_nom ORDER BY avg DE...

Group mysql query by 15 min intervals

I've got a monitoring system that is collecting data every n seconds (n ~=10 but varies). I'd like to aggregate the collected data by 15 minute intervals. Is there a way to corral the timestamp column into 15 minute chunks to allow for grouping to work? ...

How to (try)parse a single String to DateTime in "DD/MM/YYYY" format? (VB.Net)

How to (try)parse a single String to DateTime in "DD/MM/YYYY" format? (VB.Net) For example: I use input string "30/12/1999" (30 December 1999), how to (try)parse it to DateTime? ...

Does python have a session variable concept???

I have a datetime.date variable in python.I need to pass it to a function do operations according to the date given and then increment the date for the next set of operations.The problem is I have to do the operations in diff pages and hence I need the date as a variable which can go from page to page. Can we do this in python....... Thi...

MySQL, Coldfusion, Selecting records that were timestamped in the last 24 hours.

With Coldfuson & MySQL - How to update the query to check for new entries that have a timestamp that occurs in the last 24 hours? Query: <cfquery name="caller.sel_BlogEntries" datasource="#request.db#"> SELECT blogentry.dateAdded, person.personName FROM blogentry INNER JOIN person ON blogentry.personID = person.personID WHE...

How do I output time for california?

How can I output the current time in California from my website? I want visitors to know the current time for my application. ...

Date format in SQLite - iphone - How ?

I know that - SQLite doesn't support Day name & month name. I have gone through this question. I have created two custom functions for it. My custom function for Converting Day name from day number ( %w day of week 0-6 with sunday==0 ) +(NSString*)dayNameStringFromDayNo:(NSString*)dayNo{ return ([dayNo isEqualToString:@"0"])?...

How to format a datetime so that Excel will understand it?

I have a script which outputs a CSV file. How should I format dates or date+time fields so that Excel will correctly parse that field as a date? PS: I'd like to keep timezone information intact as well. ...

How to get the Currnet Date & Time Automatically to a Date TIme Field

Hi, i have created a date time field i made Todays Date as the default value, Then i added it to a page layout and created a page, But the current Date Time is not picking up from the system. I dont want to give the user to select a Date Time instead it should populated Automatically is there anyway to acheive this without writing cod...

Calculate actual time from different timezones in php

Hai, I would like to calculate actual time from different timezones. I have two mysql tables 1.Timezone table: This table contians two fields (offset value, country name) values are ( -12:00, Eniwetok, Kwajalein) (-11:00, Midway Island, Samoa).... so on 2.My employee table This table contains the employees details with two field ...