Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DateFormats in SQL and different culturesDateFormats in SQL and different cultures
Previous
 
Next
New Post
4/23/2007 8:06 AM
 

Hi,

My SQL is a bit rusty and I need some advice on how to handle dateformats in module please.

Basically I use user-inputted dates in some of my modules (like the DOB field in the ST UserProfile module). Occasionally some users report errors with date conversions - the most recent was a German user.

To fix the problem, I inserted SET DATEFORMAT mdy at the top of the SPs. My logic for this is that regardless of what culture the DB thinks it is in (it gets it from Windows I think) - I treat all dates as mdy. I have seen a solution where the business layer appended this SQL statement to every single DB call, thereby ensuring it was consistent across the app.

The other part of this question is the user-inputted side - does the calendar control check the browser culture or the user's specified culture in DNN and mask the date accordingly? Is it then converted into the default DB format based? So are all dates converted internally to the same format as long as I use the core Calendar control, or do I have to do some code to check for this? Can I assume all dates in the DB have been converted?

So, my questions:

  1. How do other people handle user-dates across different cultures?
  2. Should I use ymd or mdy, or does it matter as long as I am consitient across the module
  3. How does the UI handle different cultures and do I need to do anything around this/
  4. Any advice??

I did a search on the forums for "Set Dateformat" and there was only 1 result in the last year, and that was a snippet from the Blog SQL that sets the format to be mdy...


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/4/2007 7:18 AM
 

Anyone got any thoughts on this?


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/4/2007 8:14 AM
 

setting date formats should not be done at the sql level but rather from the ui level. 

you should parse the date string based on the locale/culture of the logged user.  This way you can pass the data object to the the dal and not have to worry about the different formats.

 

 
New Post
5/4/2007 8:51 AM
 

I agree.

SQL server only stores da/time information on a date/time field.

The system showing that data is in charge of date localization (Presentation layer)


Locopon
Free modules: E-commerce, Complete localization (Portal, page, module settings, skins, etc.), Secure Login, and more
http://dnn.tiendaboliviana.com
 
New Post
5/5/2007 3:08 PM
 

Thanks for the replies. Something is not quite right as I use the DNN core Date Selector which I thought would handle the date formatting for me, but on a German installation my module fell over, so I'll have to try and trap where the problem is.

 


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DateFormats in SQL and different culturesDateFormats in SQL and different cultures


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out