T-SQL DateTimestamps

My setup
  • Windows XP SP3
  • MS SQL Server Management Studio 2008
  • SQL Server 2008 R2
  • Regional Setting: London BST (British Summer Time)

Tuesday the 11th of October 2011 at 06:00am:
copyraw
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 0)		Oct 11 2011 6:00AM
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 1)		10/11/11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 2)		11.10.11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 3)		11/10/11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 4)		11.10.11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 5)		11-10-11
CONVERT(CHAR(9), CURRENT_TIMESTAMP, 6)		11 Oct 11
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 7)		Oct 11, 11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 8)		06:00:00
CONVERT(CHAR(26), CURRENT_TIMESTAMP, 9)		Oct 11 2011 6:00:00.000AM
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 10)		10-11-11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 11)		11/10/11
CONVERT(CHAR(6), CURRENT_TIMESTAMP, 12)		111011
CONVERT(CHAR(24), CURRENT_TIMESTAMP, 13)	11 Oct 2011 06:00:00.000
CONVERT(CHAR(12), CURRENT_TIMESTAMP, 14)	06:00:00:000
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 20)	2011-10-11 06:00:00
CONVERT(CHAR(23), CURRENT_TIMESTAMP, 21)	2011-10-11 06:00:00.000
CONVERT(CHAR(20), CURRENT_TIMESTAMP, 22)	10/11/11 6:00:00 AM
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 23)	2011-10-11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 24)		06:00:00
CONVERT(CHAR(23), CURRENT_TIMESTAMP, 25)	2011-10-11 06:00:00.000
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 100)	Oct 11 2011 6:00AM
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 101)	10/11/2011
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 103)	11/10/2011
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 104)	11.10.2011
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 105)	11-10-2011
CONVERT(CHAR(11), CURRENT_TIMESTAMP, 106)	11 Oct 2011
CONVERT(CHAR(12), CURRENT_TIMESTAMP, 107)	Oct 11, 2011
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 108)	06:00:00
CONVERT(CHAR(26), CURRENT_TIMESTAMP, 109)	Oct 11 2011 6:00:00:000AM
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 110)	10-11-2011
CONVERT(CHAR(10), CURRENT_TIMESTAMP, 111)	2011/10/11
CONVERT(CHAR(8), CURRENT_TIMESTAMP, 112)	20111011
CONVERT(CHAR(24), CURRENT_TIMESTAMP, 113)	11 Oct 2011 06:00:00:000
CONVERT(CHAR(12), CURRENT_TIMESTAMP, 114)	06:00:00:000
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 120)	2011-10-11 06:00:00:000
CONVERT(CHAR(23), CURRENT_TIMESTAMP, 121)	2011-10-11 06:00:00.000
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 126)	2011-10-11T06:00:00
CONVERT(CHAR(19), CURRENT_TIMESTAMP, 127)	2011-10-11T06:00:00
CONVERT(CHAR(32), CURRENT_TIMESTAMP, 130)	14 ?? ?????? 1432 06:00:00:000AM
CONVERT(CHAR(25), CURRENT_TIMESTAMP, 131)	14/11/1432 06:00:00:000AM
  1.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 0)        Oct 11 2011 6:00AM 
  2.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 1)        10/11/11 
  3.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 2)        11.10.11 
  4.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 3)        11/10/11 
  5.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 4)        11.10.11 
  6.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 5)        11-10-11 
  7.  CONVERT(CHAR(9), CURRENT_TIMESTAMP, 6)        11 Oct 11 
  8.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 7)        Oct 11, 11 
  9.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 8)        06:00:00 
  10.  CONVERT(CHAR(26), CURRENT_TIMESTAMP, 9)        Oct 11 2011 6:00:00.000AM 
  11.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 10)        10-11-11 
  12.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 11)        11/10/11 
  13.  CONVERT(CHAR(6), CURRENT_TIMESTAMP, 12)        111011 
  14.  CONVERT(CHAR(24), CURRENT_TIMESTAMP, 13)    11 Oct 2011 06:00:00.000 
  15.  CONVERT(CHAR(12), CURRENT_TIMESTAMP, 14)    06:00:00:000 
  16.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 20)    2011-10-11 06:00:00 
  17.  CONVERT(CHAR(23), CURRENT_TIMESTAMP, 21)    2011-10-11 06:00:00.000 
  18.  CONVERT(CHAR(20), CURRENT_TIMESTAMP, 22)    10/11/11 6:00:00 AM 
  19.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 23)    2011-10-11 
  20.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 24)        06:00:00 
  21.  CONVERT(CHAR(23), CURRENT_TIMESTAMP, 25)    2011-10-11 06:00:00.000 
  22.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 100)    Oct 11 2011 6:00AM 
  23.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 101)    10/11/2011 
  24.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 103)    11/10/2011 
  25.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 104)    11.10.2011 
  26.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 105)    11-10-2011 
  27.  CONVERT(CHAR(11), CURRENT_TIMESTAMP, 106)    11 Oct 2011 
  28.  CONVERT(CHAR(12), CURRENT_TIMESTAMP, 107)    Oct 11, 2011 
  29.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 108)    06:00:00 
  30.  CONVERT(CHAR(26), CURRENT_TIMESTAMP, 109)    Oct 11 2011 6:00:00:000AM 
  31.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 110)    10-11-2011 
  32.  CONVERT(CHAR(10), CURRENT_TIMESTAMP, 111)    2011/10/11 
  33.  CONVERT(CHAR(8), CURRENT_TIMESTAMP, 112)    20111011 
  34.  CONVERT(CHAR(24), CURRENT_TIMESTAMP, 113)    11 Oct 2011 06:00:00:000 
  35.  CONVERT(CHAR(12), CURRENT_TIMESTAMP, 114)    06:00:00:000 
  36.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 120)    2011-10-11 06:00:00:000 
  37.  CONVERT(CHAR(23), CURRENT_TIMESTAMP, 121)    2011-10-11 06:00:00.000 
  38.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 126)    2011-10-11T06:00:00 
  39.  CONVERT(CHAR(19), CURRENT_TIMESTAMP, 127)    2011-10-11T06:00:00 
  40.  CONVERT(CHAR(32), CURRENT_TIMESTAMP, 130)    14 ?? ?????? 1432 06:00:00:000AM 
  41.  CONVERT(CHAR(25), CURRENT_TIMESTAMP, 131)    14/11/1432 06:00:00:000AM 
I originally got a list from databases.aspfaq.com but the convert numbers didn't correspond to the output formats. This is my list created within my environment and setup (see above).
Category: Transact-SQL :: Article: 329

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.