0

Iam new in codeigniter. I tried to convert a user input date with format dd-mm-yyyy to mysql format yyyy-mm-dd. But I got only the functions here https://www.codeigniter.com/user_guide/helpers/date_helper.html. Is there any way to do this? Please help. Thanks in advance..

1 Answer 1

2

php can do that, you don't need codeigniter helper

echo date('Y-m-d', strtotime('18-10-2014'));
Sign up to request clarification or add additional context in comments.

1 Comment

You are right, just declare before a variable with date, and put the variable instead of '18-10-2014'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.