| Author |
Date Format as British
|
|
| Kamal Ahmed 2005-11-30, 7:23 am |
| Hi All,
I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
Database. What I will have to do for this.
TIA
| |
|
|
| Absar Ahmad 2005-11-30, 7:23 am |
| Hopefully following posting can help you:
http://www.microsoft.com/technet/co...E3004596A551&ca
tlist=328BAFD2-1A81-4558-B1DE-B6EB49F31B7E&dglist=&ptlist=&exp=&sloc=en-us
"Kamal Ahmed" wrote:
> Hi All,
>
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database. What I will have to do for this.
>
> TIA
>
>
>
| |
| David Portas 2005-11-30, 7:23 am |
| Kamal Ahmed wrote:
> Hi All,
>
> I want to set Date format as British (i.e. dd/MM/yyyy 30/11/2005) in my
> Database.
Why? DATEFORMAT is set in each connection so the database setting is
pretty redundant. Best practice is to ignore the DATEFORMAT setting and
write code that performs correctly however this may be set. Crucially
this means that any hard-coded dates should be coded in ISO rather than
local format:
'YYYYMMDD'
or
'YYYY-MM-DDThh:mm:ss'
or
'YYYY-MM-DDThh:mm:ss.mmm'
All other date values should be handled as DATETIME or SMALLDATETIME
(which are unaffected by the format setting) or converted from strings
using the CONVERT style property.
--
David Portas
SQL Server MVP
--
|
|
|
|