select now() will output 2012-11-20 09:05:38.
select substr(now(), locate(' ', now())) will output 09:05:38.
How can I obtain this result: 2012-11-20 instead? Been there, done that but can’t achieve it yet. Forgive me for my lacking but please help me. Thanks!
Not an specific answer to your question about substrings, but if I wanted the DATE part of NOW() I would do:
Or for the time portion
For actual string purposes though you can use:
Or