For sql server you use the convert function with a style and maybe subtrings.