.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Date issue where the date stored in the db is one day delayed from the actual date set

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

hi -

i would like to ask if anyone encountered this issue,

i set the date to be 5/17/2011 in an entry to my sharepoint list

but when i checked the database, the date stored is one day delayed its, 5/16/2011

please help me.


View Complete Post

More Related Resource Links

Issue with date addition



I am using ASP.NET, C# 2.0.

I am having a date issue. The error is "Year, Month and Day parameters describe an un-representable Datetime"

I am adding the date with 14 and 7 depending on a condition.

Below is the code I have used:

DateTime d = DateTime.Now;
int addDays =0;

if (Convert.ToString(Session["School"]) == "US" )
addDays = 14;
addDays = 7;

DateTime n = new DateTime(d.Year, d.Month, d.Day + addDays);


 The issue happens, if the date is 17 for US Schools and 25 for other schools, if the month has 30 days. This issue will happen for 28 days in February, and 30,31 days for other months.

How to add this 14 and 7 depending on the months. I know i have to increment the month by 1 and increase the date to the next month( and increase year to next, if done in december). But not sure, how to do this.

How to add this?

Thank you

Deserialization issue with returned from web service

Hi, I have a VS 2008 C#  client using a proxy generated by the Service Reference tool from a schema for a (prob Java?) ASMX web service.  I got serialisation errors when I tried connecting to the service around<xs:date> date fields, and on inspecting the incoming XML discovered the date format was yyyy-mm-dd hh:mm:ss.sss.   So 2 questions really.. 1) Is the schema I've been supplied with incorrect? 2)Is there a way to work around this, apart from manually editing the schema to xs:datetime and regenerating the classes?   Thanks MJ

Weird Date vs Date/Time issue using a calculated column

I'm attempting to use the fab 40 attendance template. I don't need the time to show - Im able to hide that on the forms with jquery (endusersharepoint.com thank you!!) I WAS ATTEMPTING to create a calculated column called Start Date where the formula simply reads '=[Start Time]' When it's set to display 'Date Only' the date is off by a day. If I switch it to 'Date & Time' I get the correct date. Huh?

DATE datatype and Stored Procedures

It appears the SSIS doesn't support the date datatype as an input to a stored procedure. Please advise...Say you have the following procedure defined. CREATE PROCEDURE usp_SSIS_Date_Test @SubmitDate date AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here END GO Then you want to use it in an OLE DB Command in a data flow.The following error results: "Operand type clash: int is incompatible with date",Error at Data Flow Task []: Unable to retrieve destination column descriptions from the parameter of the SQL command.If I change the type from "date" to "datetime" in the stored procedure, everything works great. I would like to use the procs (hardened in production) as is. Short of wrapping all of them in procs with "datetime" and do the conversion myself, any suggestions?

Droping a time stamp from a date stored in SQL 2008.


I am printing the data from a SQL 20008 column with a data type of "Date" but when I do it adds in 12:00:00AM to the date. If I look in mangament studio no time stamp is being stored in SQL but when I print it I get the date stored in the column but it adds a time. I have tried useing string.format() trying to remove it but it does not (tried using mm/dd/yyyy for the format). How can I prevent the time from being added to the date? I am  not sure if this is something wrong on the DB side or not. If this is not a SQL error and this post belongs somewhere else please move it there and sorry for posting in the wrong section. 

Issue with CAML Query regarding date comparision.

I have a below query in one the eventhandlers. All I do in the query is to get all records where Next_Date column is < CurrentDateTime ( I have shown current date below in full date format but it will be variable).

What I am observing is the comparision seems to be failing or not considering time format. For example the below query should not return any records when NEXT_DATE is 9/30/2010 23:59:59 and CurrentDateTime is 9/30/2010 06:22:22. However the query does return records. It looks like the comparision is just happening with Date and not time. What could be the problem? Please suggest.

         <FieldRef Name='Next_x0020_Date' />
         <Value Type='DateTime'>2010-09-30T13:13:13Z</Value>
      <FieldRef Name='Next_x0020_Date' Ascending='False' />

Display Long Date Issue


I want to display my date as 15 October 2010. I am trying to use this:

=FormatDateTime(Today(), DateFormat.LongDate)

But am getting Friday, October 15, 2010. How can I format it properly?

help inserting an empty string and a default date thru a stored procedure


I want to insert an empty string in a nvarchar field and a default date like a base date in a datetime field inside a stored procedure without passing it the value thru a parameter

how is this done?

INSERT INTO deals_SoldItems (











this dont work



"Date&Time" column in list - set actual time and sharepoint's proposes wrong hour (eg. 17:00 instea


I created new column in list - Date and time (Date and time format: Date&Time, Default value: Today's Date)

The problem is, when I create new item in list, the default time is always set as next full hour, eg. now it's 13:15 or 13:31 ora 13:57 and in aspx form it's all the time 14:00. Obviously, I can change that date with 5 minut precision (13:05, 13:10, 13:15 etc.), but it's kind of annoying.

Problem with decryption data in stored procedure if local date on my machine was changed


Hi people!

Can anybody help me with my problem?

I have one machine (Server 2003 x64 SP2, SQL Server Standard Edition (64-bit) version 9.00.4053.00). Also I have a stored procedure in database that doing a validation of users, and contains the next code:

OPEN SYMMETRIC KEY PasswordFieldSymmetricKey
  CONVERT(varchar, DecryptByKey(EncryptedPassword)) AS 'Password'
  FROM [User]
  WHERE ([Login] = @Login)
        AND (CONVERT(varchar, DecryptByKey(EncryptedPassword)) = @Password);
CLOSE SYMMETRIC KEY PasswordFieldSymmetricKey;

All works correctly but if i change the "Date and Time Properties" on my machine i receive the next error

(0 row(s) affected)
Msg 15315, Level 16, State 1, Procedure user_login, Line 111
The key 'PasswordFieldSymmetricKey' is not open. Please open the key before using it.

If i set the current date it will work correctly again.
One strange thing:
if execute the query "SELECT * FROM sys.symmetric_keys" i have the next date of creation for my symmetric keys

2010-11-04 11:18:49.300

And if i set a date less then date of

Date Time issue in Sharepoint Designer workflow



I am trying to format the date in a Sharepoint workflow (using Sharepoint Designer 2007) so that it does not include the time.  Does anyone know how this can be done?


Any help greatly appriciated...



Srikanth Reddy




stored procedure for getting date,timme



i wish to create a stored procedure which can retrieve the date or time less than or greater than current sys date.. in my table, date and time are as separate fields..

thanks in advance

!< Ganesh >! Do not tell the world whom you are...Show it... !!

date not getting stored in proper format in vb 6.0 and sql server 2000

i have a form which accept date in dd/mm/yyyy format from the user but  when i am storing it into sql server , some time it is getting stored in
dd/mm/yyyy format and some time in mm/dd/yyyy format. When i try to retrive date from sql server  and fetch it into text box it is geting  displayed in other format . some time in dd/mm/yyyy  and  mm/dd/yyyy format .
my reginal date setting is in mm/dd/yyyy format .
will be great if i get a quick help on this issue

Issue with Pause Until Date


I'm trying to get a Pause Until Date action to work.  The problem is that when it reaches the date it never continues the workflow.  I've looked at a number of previous posts about issues with this action.  Most of them are from 2008 to 2009.  They speak about service packs, hot fixes, issues with .net framework, changes needed to be made by STADMIN.  But none of them that I can see talks about a clear resolution to the issue. Let me lay out the scenario and see if I'm doing something wrong.

I have an column called end date.  Because I want to have the workflow fire the day after end date, I created a calculated column called Run Date which adds 1 day to the end date.  I've checked and the Run Date is being calculated correctly. In the first step of my workflow I added a Pause Until Date action pointing to the column Run Date as the date to resume.  But it never resumes the workflow.

Here's the environment I'm working with:

Date conversion issue



I am using 2 SQL instances, one is remote on the server and one local on my machine.  Both instances have British date format settings, but one performs different to another.  I am calling a function in SQL Server from Access VBA.

For example, when I pass a date to a local instance in this format #31/03/2011# it doesn't work, although the date settings is British.

But when I pass to remote instance works fine on both formats, #31/03/2011# and #03/31/2011#  also the date settings is British.

I dont' understand why this happening. 

Can I also ask how to pass a date from MS Access VBA to SQL Server 2008 R2 in this format: yyyymmdd ?  As I thought the format is universal within SQL Server and should interpret dates regardless on settings.


Thank you

Date issue in jqgrid


Hi team,


In my project i have to display date columan in jqgrid i'll sending date formate like 5/21/2011 12:00:00 AM to jqgrid

but the grid prints like /Date(1305916200000)/ and my grid col is


{ name: 'Date', index: 'Date', width:100, center: 'right', sorttype: "datetime", datefmt: "m/dd/yyyy h:i AMPM", search: true, sortable: true },

please help me in this issue................

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend