jchronic
jchronic copied to clipboard
Anchors do not honour timezone
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;
}