getdate

Retriving date in sql server, CURRENT_TIMESTAMP vs GetDate()

Using SQL server - which is the fastest or best practice method to use for date retrival? Is there a difference? ...

Hour difference between Linux and Windows from Java date.getHour().

I have some java code that parses a string and creates a Date object. On Linux, everything works fine, but on Windows it continuously starts at 19:00:00 rather than 00:00:00. Here is the code: if(currTask != null) { if((m = p0.matcher(currTask)).matches()) { date = new Date(Long.valueOf(m.group(2)) - Long.valueOf(m.group(1))); ...

Does GetDate() get re-evaluated for each iteration within loop within a transaction?

I have a scenario where I am looping through a resultset within a transaction and I need to INSERT a unique datetime value within a table for each iteration through the resultset - will GetDate() be recalculated each time or will it only be calculated the first time and then be the same for each iteration through the loop? My pseudo-c...

Incorrect syntax near ')' calling storedproc with GETDATE

Maybe I am having a moment of 'afternoon', but can anyone explain why I get Msg 102, Level 15, State 1, Line 2 Incorrect syntax near ')'. When running CREATE PROC DisplayDate ( @DateVar DATETIME ) AS BEGIN SELECT @DateVar END GO EXEC DisplayDate GETDATE(); ...

JavaScript's getDate returns wrong date

The following script returns 20 instead of 21! var d = new Date("2010/03/21"); document.write(d.getDate()); What am I doing wrong? Is this a JavaScript bug? ...

Changing the output of Getdate

Is it possible to deceive SQL Server to return a different date on GetDate() without actually changing the machine date? This would be great, since we have a database with old data and I'm trying to test some queries that use getdate(). I can change my machine date but that brings some other problems with other applications... Any tips? ...

problem with sql job and datetime parameter

Another developer created a stored procedure that is set up to run as a sql job each month. It takes one parameter of datetime. When I try to invoke it in the job or in just a query window I get an error "Incorrect syntax near ')'" The call to execute it is... exec CreateHeardOfUsRecord getdate() When I give it a hard coded date lik...

getdate() in mysql

I am creating a system which updates the user activity when something is done. I have a variable $userhistory= 'User edited '.$info.' on July 14 2010 or (07-14-2010); I want to know how can i get the date automatically. for sql query i am using NOW(), but in a variable like $userhistory how do i get the date and it want it only in eithe...

Precision of SQL Getdate?

I am experimenting with a program that inserts data into an SQL 2005 Server database (on XP SP3) at high rate of speed. (This is for collecting timing data so I can evaluate different aspects of my design). My basic set up involves inserting a data into a table like the following (and using an SP that just specifies the payload field...

Selecting GETDATE() function twice in a select list-- same value for both?

Hi everyone, I have a SELECT statement that uses GETDATE() for two different column values. I'm wondering if by the nature of things those two separate function calls in the same SELECT will return identical values every time? ...