I've datetime value 2020-06-29 18:12:23
and I am trying to convert this to 20200629181223
format in both SQL Server & Postgres
Any thoughts please? Thanks!
You can also use to_char
method like following on postgres
to_char(created_date, 'dd/mm/yyyy')
created_date is of type timezone with timezone
here
You can read more use cases here
This is easy with a convert and nested replace functions:
select replace(replace(replace(convert(varchar,getdate(),120),' ',''),'-',''),':','')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With