Hidden input from full date (yyyy-mm-dd) to year & month (yyyy-mm) in php

Dear All

I have a DB with some field. There are field as deliverydate & deliveryyearmonth.

In the deliverydate field date format is yyyy-mm-dd, now i want to input hidden value in the deliveryyaermonth field is “yyyy-mm” from the full date format for the field of deliverydate.

Is it possible to do it in php?

PHP: substr - Manual

Thanks, but sorry to inform you, I haven’t got any good information on that link.

Why? You’ve got a string ‘yyyy-mm-dd’, you want to make it ‘yyyy-mm’, that page explains how to do it.

Why don’t you post the code you have so far, and tell more specifically what the thing is you don’t understand.