Skip to content
Permalink
Browse files
Time#getlocal(nil) should act like no-arg. Fixes #2310.
  • Loading branch information
headius committed Dec 15, 2014
1 parent fc05939 commit 8fe3ae7b07bb1732ea98402226581c2dcea5aa71
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/src/main/java/org/jruby/RubyTime.java
@@ -428,7 +428,7 @@ public RubyTime getlocal() {

@JRubyMethod(name = "getlocal", compat = RUBY1_9, optional = 1)
public RubyTime getlocal19(ThreadContext context, IRubyObject[] args) {
if (args.length == 0) {
if (args.length == 0 || args[0].isNil()) {
return newTime(getRuntime(), dt.withZone(getLocalTimeZone(getRuntime())), nsec);
} else {
Matcher tzMatcher = TIME_OFFSET_PATTERN.matcher(args[0].toString());

0 comments on commit 8fe3ae7

Please sign in to comment.