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

coordinate time format behavior for date convert in STRING #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

giwa
Copy link
Contributor

@giwa giwa commented May 6, 2020

Since time parse is slow, it's worth to let user select parsing behavior. Somehow DATE convert in STRING does not provide this option.

@giwa giwa force-pushed the coordinate-string-date-behavior branch from a0993f8 to 9e59f02 Compare May 6, 2020 08:11
@giwa giwa marked this pull request as ready for review May 6, 2020 23:21
with_typecast_error(val) do |val|
TimeWithZone.set_zone_offset(Time.parse(val), zone_offset).strftime("%Y-%m-%d")
end
}
Copy link
Member

@sonots sonots Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using @timestamp_format as a flag looks weird because it is not required to parse val here. TIMESTAMP and DATETIME uses @timestamp_format, but DATE does not.

Time.strptime(val, @timestamp_format).strftime("%Y-%m-%d %H:%M:%S.%6N")

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

Successfully merging this pull request may close these issues.

2 participants