日期格式化怎么去掉后边的时分秒

这么些不行 让我转成String类型

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        prpSmain.setMakeDate(sdf.format(new Date()));/*出单日期*/

import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {

public static void main(String[] args) {

    Date date = new Date();
    SimpleDateFormat Format = new SimpleDateFormat("yyyy-MM-dd");
    String time = Format.format(date);
    System.out.println(time);
    System.out.println("转成String为"+time.toString());

}

}

long l = System.currentTimeMillis();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date(l);
String time = dateFormat.format(date);