Fun with US and UK dates on a new server -


i have had "pleasure" of moving old asp website / sql db new dedicated ovh server (french - defaults set us-eng)

the db has moved sql 2005 sql 2012 (web edition 64 bit).

i having old issue of date formats showing format on website e.g 8/3/2016 instead of 03/08/2016. though in database stored iso date 2016-08-03 etc.

i enter dates on asp classic, website uk format
e.g 03/08/2016 , convert them iso format 2016-08-03 in sql passed stored procedure has set dateformat ymd @ top of it.

if check tables in db stored correctly iso dates.

i have made sure sql logins db have "british english" selected "default language".

if view database properties under options default language british english.

if view server properties under general->language it's english (united states) under advanced->default language it's british english.

the dates getting stored iso correctly if datediff(day,stamp,getdate())=0 can see records though showing on website format 8/3/2016 (why there no zeros in front of dates don't know)

the asp code hasn't changed or db code ported new dedicated server , getting these issues. sure solved ages ago changing default login language doesn't seem work on box.

i getting lots of primary key/index errors due duplicate insertions due dates (mixing us/uk) .net app have uses betfair api racing data e.g

exec dbo.usp_net_insert_betfair_market_selection @marketid = 125932808, @selectionid = 10593225, @racedatetime = '2016-08-03 15:10:00', @markettype = 'win', @horsename = 'she done good'; 

violation of primary key constraint 'pk_betfair_market_selections'. cannot insert duplicate key in object 'dbo.betfair_market_selections'. duplicate key value (719859, win, mar 8 2016 3:10pm).

however if copy exec statement , run direct in query analyser window runs without error.

i have been googling head off , have seen suggest putting code @ top of asp pages show dates force show in uk format > https://www.webwiz.co.uk/kb/asp-tutorials/date-time-settings.htm

'* set server locale uk session.lcid = 2057

this has worked on pages have never had before.

on pages long lists of records , dates in 1 column have wrapped date in convert(varchar, getdate(),103) in sql , returns correctly on page.

i confused though have never had on old set , seems there must setting needs change fix on new server (sql , web iis 8) on same box.

i have tried going .net globalization site , changing culture , ui culture english (en). didn't fix everything.

the "language" preferences on machine set english (uk) although wouldn't have though have made difference.

if run code in query analyser either rd box, or through local sql console connected machine on network

select name ,alias, dateformat syslanguages langid = (select value master..sysconfigures comment = 'default language')

in query window (remote desktop server) back

name alias dateformat british british english dmy

ask:
seems connection between asp website or .net app , server/database. have missed or need change worked fine on old webserver -> database server setup had.

can think of have overlooked or need ensure dates shown uk on website without editing every asp page , sql contains dates never had old setup.

thanks in advance help!


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -