Using SQLite.
ltrim(ltrim(substr(tablename.time, 11),'0123456789'),'-') as main_time
I have the above trim
function which removes the first 11 characters from my string below.
2013-10-28 09:29:57.987 -- Original String.
09:29:57.987 -- New String.
However I'd still like to remove the last four characters from the end of the string, turning it into the below:
09:29:57
Use LENGTH
:
SUBSTR(your_string, 1,LENGTH(your_string)-4)
However, in your case is just specify fixed positions:
SUBSTR(tablename.time, 12, 8)
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