-->
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.  [ 2 posts ] 
Author Message
 Post subject: DateTime culture issue
PostPosted: Thu May 28, 2009 9:43 am 
Newbie

Joined: Thu May 28, 2009 9:04 am
Posts: 1
Hi all,

We currently use SQL Server 2005 with collation Danish_Norwegian_CI_AS and the web server executing queries has its regional date settings set to dd.MM.yyyy. The dates that appear in sql generated by NHibernate becomes: '27.04.2009 15:06:21' (27th of April 2009), which correspond to the regional date settings and should also correspond to the SQL collation. This however result in the following sql exception: "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."

This is a sql issue, but related to this I have two questions:
1) Is NHibernate suppose to take regional settings into account and not use invariant (DateTime.ToString() .vs. DateTime.ToString(CultureInfo.InvariantCulture)) or use ISO (yyyy-MM-dd)?
2) What is the recommended solution to culture settings in NHibernate, specifically related to dates? Can we control them?

Thanks,

Jon Arild Tørresdal


Top
 Profile  
 
 Post subject: Re: DateTime culture issue
PostPosted: Fri Aug 14, 2009 8:28 am 
Newbie

Joined: Fri Aug 14, 2009 8:05 am
Posts: 1
Jeg ved intet om hvordan Hibernate understøtter internationale datoer, men jeg har efter en dags tid riven i håret fundet ud af at man kan gå til SQL Server Enterprise Manager, så klikke local->Security->Logins, og så se egenskaber for den bruger man nu logger på med. Her vælger man så sproget English.
Hvis man bruger AD brugere, ved jeg dog ikke lige hvor man klikker henne, men idéen må være den samme.


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

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.