catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Database Support

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 29-02-2008, 03:09 PM   #1 (permalink)
Registered User
 
Join Date: Mar 2006
Posts: 9
date times

using sql 2005 and .Net here on the Catalyst server.

In my web site i'm storeing dates into the database and there getting stored like so 14/08/2008 00:00:00

perfect this is how I want it. however when I retrieve the dates back to the website there getting change to 8/14/2008 12:00:00

any ideas why its doing this as on my local build its retrieving things fine.
I've even tried using

CultureInfo cultEnGb = new CultureInfo("en-GB");

and formatting the date using this but still comes out in mm/dd/yyyy format any ideas ?
agentwalker is offline   Reply With Quote
Old 29-02-2008, 03:43 PM   #2 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,536
Hi,

If you set the culture in your web.config does the same happen?
paulredpath is offline   Reply With Quote
Old 29-02-2008, 04:11 PM   #3 (permalink)
Administrator
 
WhiskyFudge's Avatar
 
Join Date: Oct 2003
Posts: 1,484
I'm quite suprised your having this problem, most of my sites store dates and times and it all works out of the box. Are you doing any form of conversion?
__________________
Jason Robbins
jason@catalyst2.com
WhiskyFudge is offline   Reply With Quote
Old 10-03-2008, 09:44 PM   #4 (permalink)
Registered User
 
Join Date: Apr 2006
Posts: 4
Culture settings

Not sure what you mean by culture settings, so just thrown this tag into the web config file.

<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-DE"
/>

Still no joy...
The only conversion I'm doing is running the site through the publish function in visual studio.
Denster is offline   Reply With Quote
Old 10-03-2008, 11:17 PM   #5 (permalink)
Administrator
 
WhiskyFudge's Avatar
 
Join Date: Oct 2003
Posts: 1,484
Your culture settings are somewhat curious and where the error may be occuring. The culture the servers are servers are set at is en-GB. Your code is currently set to handle US style dates (MM/dd/yyyy) where your passing them European style dates (dd/MM/yyyy). I would suggest you change your culture settings to en-GB unless your are actually creating a german site (as suggested by the de-DE uiCulture string).

HTH

Jas
__________________
Jason Robbins
jason@catalyst2.com
WhiskyFudge is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:44 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.