GithubHelp home page GithubHelp logo

Parse date/time formats about haven HOT 10 CLOSED

tidyverse avatar tidyverse commented on May 20, 2024
Parse date/time formats

from haven.

Comments (10)

hadley avatar hadley commented on May 20, 2024
  • Update ReadStat to get latest behaviour
  • Add POSIX support to TimeFormatStrings or wait for Rexamine project

from haven.

hadley avatar hadley commented on May 20, 2024

@afleishman since you're interested, is there any chance you could make me a sav file containing date times with one column for each date-time type?

from haven.

afleishman avatar afleishman commented on May 20, 2024

Of course. I created this file using write_sav. There are three columns -- First, is date type, next is POSIXct, and finally character. Let me know if you need anything else!

https://github.com/afleishman/spss/blob/0244b4836c63adff180cbf65ec0a9182733fc19b/test_haven.sav

from haven.

hadley avatar hadley commented on May 20, 2024

@afleishman can you please create with spss? (not haven, since that's what I'm trying to test)

from haven.

afleishman avatar afleishman commented on May 20, 2024

https://github.com/afleishman/spss/blob/master/test_spss.sav

from haven.

hadley avatar hadley commented on May 20, 2024

@afleishman could you add a column with a time variable please?

from haven.

afleishman avatar afleishman commented on May 20, 2024

https://github.com/afleishman/spss/blob/master/test_time_spss.sav

first column type: Date (mm/dd/yyyy)
second column type: Date (dd-mmmm-yyyy hh:mm:ss)
third column type: Date (hh:mm:ss.ss)

from haven.

hadley avatar hadley commented on May 20, 2024

I'm currently getting

        date            date.posix     time
1 2014-09-22 201416-09-22 00:00:00 12:11:10
2 2014-09-23   2014-09-23 15:59:20 15:59:20

And I suspect that the first date.posix is incorrect. What is it supposed to be?

@evanmiller any thoughts on why only the first value is getting read incorrectly?

from haven.

afleishman avatar afleishman commented on May 20, 2024

Actually, it was a typo on my part... what you've produced is correct. Sorry about that.

from haven.

hadley avatar hadley commented on May 20, 2024

In that case, awesome :)

from haven.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.