get Current Day Start Time - Android java.util

Android examples for java.util:Day

Description

get Current Day Start Time

Demo Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    private final static SimpleDateFormat shortSdf = new SimpleDateFormat(
            "yyyy-MM-dd");

    public static Date getCurrentDayStartTime() {
        Date now = new Date();
        try {//from www. j a va2 s. c o m
            now = shortSdf.parse(shortSdf.format(now));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return now;
    }
}

Related Tutorials