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

Use lubridate package for all POSIXct conversions (updated) #94

Merged
merged 2 commits into from
Feb 20, 2018
Merged

Use lubridate package for all POSIXct conversions (updated) #94

merged 2 commits into from
Feb 20, 2018

Conversation

clhunsen
Copy link
Collaborator

To be more reliable regarding the parsing and printing of dates, we introduce three functions to the misc module, all using the package lubridate to achieve the task:

  • get.date.from.string: Parses a date string to a POSIXct object.
  • get.date.from.unix.timestamp: Converts a UNIX timestamp to a POSIXct object.
  • get.date.string: Converts a POSIXct object to a string representative of the format "%Y-%m-%d %H:%M:%S".

This heavily improves the patch supplied via PR #85. Thanks to @flx5 for his work on that.
This fixes #77.


Additionally, a forgotten sqldf statement is updated to be more consistent and reliable.

For better reliability, the columns names in sqldf queries should be
escaped by backticks (i.e., gravis accents).

This patch also incorporates the changes from commit
3c878f1.

Signed-off-by: Claus Hunsen <[email protected]>
To be more reliable regarding the parsing and printing of dates, we
introduce three functions to the misc module, all using the package
'lubridate' to achieve the task:

- get.date.from.string: Parses a date string to a POSIXct object.
- get.date.from.unix.timestamp: Converts a UNIX timestamp to a POSIXct
    object.
- get.date.string: Converts a POSIXct object to a string representative
    of the format "%Y-%m-%d %H:%M:%S".

This heavily improves the patch supplied via PR #85. Thanks to @flx5 for
his work on that.
This fixes #77.

Improved-by: Claus Hunsen <[email protected]>
Signed-off-by: Felix Prasse <[email protected]>
Signed-off-by: Claus Hunsen <[email protected]>
@clhunsen clhunsen added this to the v3.1 milestone Feb 19, 2018
@clhunsen clhunsen changed the title Lubridate Use lubridate package for all POSIXct conversions Feb 19, 2018
@clhunsen clhunsen changed the title Use lubridate package for all POSIXct conversions Use lubridate package for all POSIXct conversions (updated) Feb 19, 2018
@clhunsen clhunsen requested a review from bockthom February 19, 2018 16:31
Copy link
Collaborator

@bockthom bockthom left a comment

Choose a reason for hiding this comment

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

Looks good!

(Only one very small remark: The PR contains different ways of spelling Unix. However, I guess we can neglect that ;) )

@clhunsen clhunsen merged commit 011ee6e into se-sic:dev Feb 20, 2018
@clhunsen clhunsen deleted the lubridate branch February 27, 2018 08:13
@clhunsen clhunsen mentioned this pull request Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants