Custom Date and Time formats — a sample and link



select datename(WEEKDAY, current_timestamp) WeekdayName
--SQL Server 2012 or 2014
,FORMAT(current_timestamp,'dddd') AS WeekdayName1
,FORMAT(current_timestamp,'ddd') AS ShortWeekdayName2

, FORMAT(getdate(), 'dd-MMM-yy hh.mm.ss.fffffff tt')

,format(getdate(),'HHmmssfff')

http://msdn.microsoft.com/en-us/library/ee634398.aspx

http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s