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

date_start not formatted as date #99

Open
abahl4 opened this issue Jul 27, 2022 · 2 comments
Open

date_start not formatted as date #99

abahl4 opened this issue Jul 27, 2022 · 2 comments

Comments

@abahl4
Copy link

abahl4 commented Jul 27, 2022

#Get occurrences for salpa thompsoni from OBIS - note that this may take some time to run:
my_occs <- robis::occurrence(scientificname = "Salpa thompsoni")

>my_occs$date_end[1]
[1] 474940800000

The name of the columns for date_start, date_mid, and date_end does not match the documentation seen in link below:
https://seamap.env.duke.edu/help/download_main

The date format "yyyy-mm-dd hh:mm:ss" is not correct - is there a different format for these columns?

I am using robis version 2.10.1 and R version 4.1.1

@pieterprovoost
Copy link
Member

Hi @abahl4, that documentation is specific to OBIS SEAMAP and most of the fields mentioned there are not present in the robis results (unless the names coincidentally correspond). In addition to the Darwin Core fields, robis returns a few extra fields which are documented here: https://obis.org/data/access/. date_end is a unix timestamp which can be converted to POSIXct or the required date format like this:

> date_end <- as.POSIXct(my_occs$date_end[1] / 1000, origin = "1970-01-01")
> date_end
[1] "1985-01-19 01:00:00 CET"
> strftime(date_end, "%Y-%m-%d %H:%M:%S", tz = "UTC")
[1] "1985-01-19 00:00:00"

@abahl4
Copy link
Author

abahl4 commented Jul 27, 2022

Thank you so much for your quick and helpful reply!

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

No branches or pull requests

2 participants