title: How do I get the String type or timestamp type by giving a year
body: <p>there is a requirement to get the startTime and endTime around the whole year by giving a int year, for example, given a variable <code>int year = 2017</code>, I want to get the starttime <code>String "2017-01-01 00:00:00"</code> and endtime <code>String "2017-12-31 23:59:59"</code>, or get the starttime timestamp 1483200000 and endtime timestamp 1514735999. 2 results are ok to us, How should I do by java8 or below? I have known:</p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
  String datetime = sdf.format(new Date(*timestamp*))
  </code></pre>
  
  <p>but I have no idea how I can get the timestamp by the given year, please help to check</p>