Yes i agree with dun. It is better to use the DT picker. But Dt picker returns long date. so f you want to get only the yyyy-mm-dd you can use the .format method in your string.