jchronic icon indicating copy to clipboard operation
jchronic copied to clipboard

Anchors do not honour timezone

Open akvadrako opened this issue 12 years ago • 0 comments

When parsing "last sunday", with the default timezone set to UTC+1 and options.now set to UTC, the resulting date is Sun 10AM UTC+1, not Sun 12AM UTC as I would expect (since now is UTC). The issue stems from Time.java, which doesn't copy the timezone:


  public static Calendar y(Calendar basis) {
    Calendar clone = Calendar.getInstance();
    clone.clear();
    clone.set(Calendar.YEAR, basis.get(Calendar.YEAR));
    return clone;
  }

akvadrako avatar Oct 11 '12 09:10 akvadrako