Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daylight savings logic? #149

Open
SecuritasMachina opened this issue Nov 9, 2015 · 0 comments
Open

Daylight savings logic? #149

SecuritasMachina opened this issue Nov 9, 2015 · 0 comments

Comments

@SecuritasMachina
Copy link

Hi, this unit test has been passing until recently, only real change I can think of is we recently fell back.

Below now returns 10am, instead of 9am.

   Date t = MyDateUtils.getInstance().parseDatePhrase("America/New_York", "tomorrow 9am");
   public Date parseDatePhrase(String timeZoneName, String s) {
    Date ret = null;
    if (timeZoneName == null)
        timeZoneName = "America/New_York";
    try {
        Parser parser = new Parser(TimeZone.getTimeZone(timeZoneName));
        List<DateGroup> groups = parser.parse(s);

        Date tmpDate = groups.get(0).getDates().get(0);
        ret = tmpDate;
    } catch (Exception e) {
        LOG.log(Level.SEVERE, e.getMessage(), e);
    }
    return ret;
}

are you handling the offset ?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant