This topic is locked
[SOLVED]

Request only month and year in a date field

9/10/2022 8:15:25 AM
PHPRunner General questions
A
alfonso authorDevClub member

I want to ask only the month and year. I do not want the day to be requested when completing the form. I can do it with "display: none" but the day is stored in the table field. That's normal, but if I can't avoid it, I'd like it to come out on the 1st of the month by default. Any ideas?

M
muammer 9/10/2022

https://www.w3schools.com/sql/func_mysql_date_format.asp

Hello
There are examples of converting the formats of date queries in the link I gave. it will help. You can get the data in the field with the datetime field in your table separately as the month, day, year you want with dateformat.

A
alfonso authorDevClub member 9/10/2022

thanks