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

Improvement for datetime parsinf in different timezones. #125

Closed
GoogleCodeExporter opened this issue Jul 16, 2015 · 2 comments
Closed

Improvement for datetime parsinf in different timezones. #125

GoogleCodeExporter opened this issue Jul 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?  If applicable, please provide a
mapping configuration and sample record input to recreate the problem.
1. Create mapping to file containing Date in UTC+2.
2. System default timezone is UTC+7
3. DateTime.getTime from file and DateTime.getTime() after file processing is 
different

What is the expected output? What do you see instead?
DateTime parsing in correct timezone. I want to specify timezone I have in file 
for correct processing for case when I have a lot of files with different 
timezones or two dates in different timezones in a file.

What version of BeanIO are you using? What JDK version?
BeanIO 2.1.0 JDK 1.7

Please provide any additional information below.
Fix attached for Joda implementation because it has wider support of patterns. 
It's better to have separate property in config to specify datetime timezone.

Original issue reported on code.google.com by DmitryKa...@gmail.com on 24 Oct 2014 at 12:24

Attachments:

@GoogleCodeExporter
Copy link
Author

You can set the time zone on a date type handler using the property 
'timeZoneId'.

Joda based date/time type handlers will not be included in the library, but can 
be easily implemented by users.

Original comment by kevin.s...@gmail.com on 5 Nov 2014 at 2:19

  • Changed state: WontFix
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Thank you. I've found out that already. I had to create type handler to set 
timeZoneId
    <typeHandler class="org.beanio.types.DateTypeHandler" name="UTCTimeHandler">
        <property name="timeZoneId" value="UTC"/>
    </typeHandler>

Original comment by DmitryKa...@gmail.com on 5 Nov 2014 at 10:26

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

No branches or pull requests

1 participant