title: How to convert C# DateTime to Java DateTime
body: <p>I am new to Java and I already have c# code which I have to convert it into java, but am not able to find good alternative to it. </p>
  
  <p>Below is the code that I want to convert:</p>
  
  <pre><code>private string GetDate(object value)
      {
          DateTime start = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
          var lastWeek = DateTime.Today.AddDays(-6);
          var date = start.AddMilliseconds((long)value).ToLocalTime();
          if (date &gt;= lastWeek)
          {
              if (date.DayOfWeek == DateTime.Now.DayOfWeek)
                  return "Today";
              else
                  return date.DayOfWeek.ToString();
          }
          else
              return date.ToString("dd-MM-yyy");
      }
  </code></pre>
  
  <p>I tried using Calendar class at first, but it's giving error that integer number too large:</p>
  
  <pre><code>    Calendar cal = Calendar.getInstance();
      cal.set(1970, 0, 1, 0, 0, 0);
      cal.set(Calendar.MILLISECOND, 0);
      long result = cal.getTimeInMillis();
      long value = result + 1406205185123;
  </code></pre>
  
  <p>Any solution/suggestion will be helpful. </p>