Skip to content

jorissparla/sqlnicedate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

niceDate()

A SQL Server function that with a given input, provides a 'Nice date' 😊😊😊

usage

SELECT dbo.niceDate(DATEADD(dd,12, GETDATE()))

returns e.g.

In 1 week and 5 days, at 15:28

query

SELECT getdate(),
	dbo.niceDate('2017-05-18 00:50'), 
	dbo.niceDate('2017-05-17 00:50'),
	dbo.niceDate('2017-05-18 22:50'),
	dbo.niceDate('2017-05-22 22:50'),
	dbo.niceDate('2017-05-27 22:50')

results

Today, 21 hours and 38 minutes ago	`
Yesterday at 00:50	
Today, in 21 minutes
Coming Monday at 22:50
In 1 week and 2 days, at 22:50

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages