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
PostPosted: Tue May 12, 2009 3:16 pm 
Newbie

Joined: Wed Feb 25, 2009 5:09 pm
Posts: 8
I'm having a problem retrieving dates from my database. I have a Users table that has a logged in field.

In my Users.cs file I have the following:

private DateTime _loggedIn;
public virtual DateTime LoggedIn
{
get { return _loggedIn; }
set { _loggedIn= value; }
}

In my Users.hbm.xml file I map that field like this:

<property name="LoggedIn" column="loggedIn" type="DateTime"/>

When I set the logged in field when the user logs in I set it as :

Users.LoggedIn = DateTime.Now

Once I save the user the datetime gets saved correctly...up to the second. But when i try and retrieve that DateTime I only get back the proper date...the time is always 12:00:00.

Not sure why this is happening...can anyone help me?

Thanks in advance!


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.