Skip to content

Documentation for date-time pattern #1015

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

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Conversation

DestBro
Copy link
Contributor

@DestBro DestBro commented Jan 12, 2025

This commit adds new documentation detailing how to parse date-time columns from CSV files using a specific format pattern. It explains two approaches: providing the pattern as a raw string (e.g., "dd/MMM/yy h:mm a") and supplying a DateTimeFormatter instance (e.g., DateTimeFormatter.ofPattern("dd/MMM/yy h:mm a")). These options ensure that columns are correctly recognized and parsed as date-time rather than strings.

This commit adds new documentation detailing how to parse date-time columns from CSV files using a specific format pattern. It explains two approaches: providing the pattern as a raw string (e.g., "dd/MMM/yy h:mm a") and supplying a DateTimeFormatter instance (e.g., DateTimeFormatter.ofPattern("dd/MMM/yy h:mm a")). These options ensure that columns are correctly recognized and parsed as date-time rather than strings.
@Jolanrensen
Copy link
Collaborator

Hi! Thanks for the suggestion :)

I do, however, feel the documentation now suggests that supplying a date pattern is only possible for reading CSV, while it actually belongs to the parse operation.

Any operation that can parse String columns, like readCsv, readTsv, StringCol.convertTo<>() (and probably more in the future), can have a ParserOptions argument to configure things like Locale, null-strings, date-time patterns etc. So while it's a good explanation, I think generalizing it a tiny bit and linking to the parse operation would improve it even more :).

@Jolanrensen Jolanrensen added the documentation Improvements or additions to documentation (not KDocs) label Jan 13, 2025
@Jolanrensen
Copy link
Collaborator

@DestBro Great job! I'll do some small formatting and merge it into our docs :) thanks!

@Jolanrensen Jolanrensen merged commit a4b69ec into Kotlin:master Jan 14, 2025
@DestBro
Copy link
Contributor Author

DestBro commented Jan 14, 2025

@DestBro Great job! I'll do some small formatting and merge it into our docs :) thanks!

Thank you, this is my first contribution to an open source project :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation (not KDocs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants