I have a .NET 2.0 C# application that displays a datagrid. One of the columns is a date field. The application is working fine. I just installed it on a workstation in the Pacific time zone and all of the dates are be adjusted to local time (e.g. it is appearing on the grid as 2/15/2008 9:00PM). From my machine (eastern time zone) the date shows as 2/16/2008.
Is there a setting I can use in the C# code that will turn-off the time adjustment. I do not want to make any changes on the local workstation since that will not be acceptable to the workstation owner.
Is there a way I can store the date in SQL Server that would prevent it. DateOfService and DateOfBirth is currently a DateTime field and it is updated in this stored procedure:
ALTER PROCEDURE [dbo].[sp_UpdateDocumentIn
foForMT]
@jobID int,
@documentID int,
@templateID int,
@qaTypeID int,
@docStatus int,
@firstname nvarchar(255),
@middlename nvarchar(255),
@lastname nvarchar(255),
@dateofservice datetime,
@dateofbirth datetime,
@mrn nvarchar(255),
@account nvarchar(255),
@room nvarchar(255),
@site nvarchar(255),
@gender int,
@ampm int,
@empty bit,
@inaudible bit,
@noname bit,
@addendum bit,
@truncated bit,
@missing bit,
@inaudibleCnt int,
@addressTo nvarchar(2000),
@addressCC nvarchar(2000),
@comments ntext
AS
BEGIN
UPDATE documents SET
templateID = @templateID,
qaTypeID = @qaTypeID,
cdp_ptfirst = @firstname,
cdp_ptmiddle = @middlename,
cdp_ptlast = @lastname,
cdp_dos = @dateofservice,
cdp_ptdob = @dateofbirth,
cdp_ptmrn = @mrn,
cdp_ptacct = @account,
cdp_site = @site,
cdp_ptroom = @room,
cdp_ptgender = @gender,
cdp_ampm = @ampm,
cdp_qtyinaudibles = @inaudibleCnt,
addressTo = @addressTo,
addressCC = @addressCC,
comments = @comments,
documentStatus = @docStatus
WHERE (documentid = @documentid)
UPDATE jobs SET
isblank = @empty,
isinaudible = @inaudible,
isnoname = @noname,
isaddendum = @addendum,
istruncated = @truncated,
ismissinginfo = @missing,
inaudibles = @inaudibleCnt
WHERE (jobid = @jobid)
END
Start Free Trial