-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: nHibernate DateTime auto updating issue with SQL Server 2005
PostPosted: Tue Jul 21, 2009 5:06 am 
Newbie

Joined: Tue Jul 21, 2009 4:43 am
Posts: 1
Hi I am passing a value to my attribute StartDate = "7/20/2009 12:00" (i.e I am in IST Time zone) and when it is saved in the database it is automatically saved as "7/20/2009 01:30 PM". I assume when it reaches the database, the SQL Server is automatically converting the date time to the server datetime.

If I specifically send a date like this "7/10/2009 16:30:10" then it is exactly going as it is. This problem comes only if my date is having 12AM/PM or if I set value = System.DateTime.Now.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class lazy="false" name="............................................................>
<property name="IncidentStartDate" column="IncidentStartDate" />
<property name="IncidentEndDate" type="DateTime">
<column name="IncidentEndDate" sql-type="DateTime" not-null="false"/>
</property>
</class>
</hibernate-mapping>

Any help on this would be greatly appreciated.

Thanks,
Arun.K.S


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.