0

I am trying to change the format of a time that I have stored in my database. Currently, the time is stored as such.

time           date
1300        2020-06-01
1310        2020-06-01
1315        2020-06-01

and I would ideally like to get an output that looks like this as a datestamp

time
2020-06-01 13:00:00.000
2020-06-01 13:10:00.000
2020-06-01 13:15:00.000

Is there a function to help in making this conversion?

Thanks

Ryan Reid
  • 189
  • 1
  • 3
  • 9
  • Does this answer your question? [How to obtain the start time and end time of a day?](https://stackoverflow.com/questions/10308356/how-to-obtain-the-start-time-and-end-time-of-a-day) – Basil Bourque Jul 14 '20 at 16:21

1 Answers1

1

You can use date_parse function.

select date_parse(date || ' ' || time, '%Y-%m-%d %H%i') from 
(values ('1300', '2020-06-01')) as t(time, date)
ebyhr
  • 1,537
  • 9
  • 15