Jump to content

better way of using substring?


digitalgod

Recommended Posts

hey guys,

 

I'm currently storing the date and time in a table like so 20070406145935 and I would like to output it like 06/05/2007. To do that right now I'm doing this and it works perfectly

CONCAT_WS( '/', SUBSTRING(tickets.timestamp, 7,2), SUBSTRING(tickets.timestamp, 5,2), SUBSTRING(tickets.timestamp, 1,4))

 

but I was wondering if t here was a better way of doing this though...

Link to comment
https://forums.phpfreaks.com/topic/45899-better-way-of-using-substring/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.