Questions tagged [posixlt]

Class `POSIXlt` more conveniently represents the result of Class `POSIXct` (the number of seconds since the beginning of 1970) as a numeric vector of more directly accessable values for seconds, minutes, hours, days, months, years etc.

Class POSIXct represents the (signed) number of seconds since the beginning of 1970 (in the UTC time zone) as a numeric vector. Class "POSIXlt" is a named list of vectors representing

sec - 0–61: seconds.

min - 0–59: minutes.

hour - 0–23: hours.

mday - 1–31: day of the month

mon - 0–11: months after the first of the year.

year - years since 1900.

wday - 0–6 day of the week, starting on Sunday.

yday - 0–365: day of the year.

isdst - Daylight Saving Time flag. Positive if in force, zero if not, negative if unknown.

zone - (Optional.) The abbreviation for the time zone in force at that time: "" if unknown (but "" might also be used for UTC).

gmtoff - (Optional.) The offset in seconds from GMT: positive values are East of the meridian. Usually NA if unknown, but 0 could mean unknown.

151 questions
0
votes
1 answer

`by()` changed POSIXct to numeric value in R

In R, how to prevent the by() function from changing POSIXct to numeric values automatically? In the following example, the time object is class "POSIXct" "POSIXt". When using by() function, the output is numeric. But when doing what by() does…
WCMC
  • 1,602
  • 3
  • 20
  • 32
0
votes
0 answers

ODBC - sqlQuery and date format

I am trying to retrieve data from a MySQL Database using RODBC with the commands odbcConnect and sqlQuery. There are different tables in the database and in some cases it works without any difficulties. Nevertheless I get an error with some of them…
Robisch
  • 3
  • 1
0
votes
0 answers

Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format (Help)

Want to first thank the community for your help. I am new to R and this is my first post. As mentioned earlier, I am receiving a error as I am trying to run my R markdown or in Kaggle notebook.. bike_rides$month <- format(as.Date(bike_rides$date),…
0
votes
1 answer

Converting dates into minutes in R + Error in as.POSIXlt.character message

I am pretty new to R. I have a variable with a date and hour automatically created by the survey platform (Qualtrics) named enddate. I would like to convert that variable into minutes from midnight (the dates are shown in this format: 08/03/2020…
o.y_80
  • 1
  • 2
0
votes
0 answers

I can't figure out how to resolve this error

Uploading Divvy datasets (csv files) here Oct_2020_tripdata <- read_csv("Oct 2020.csv") Nov_2020_tripdata <- read_csv("Nov 2020.csv") Dec_2020_tripdata <- read_csv("Dec 2020.csv") Jan_2021_tripdata <- read_csv("Jan 2021.csv") Feb_2021_tripdata <-…
0
votes
2 answers

Problem with changing format of date and time in R

I am having a problem with date & time format in R. My R code is having the format: "%Y%m%d %H%M%OS". For example: "20170929 20:59:56.149" Time in my case is character variable. I am trying to write a R code where type of format will be converted…
sid9715
  • 13
  • 3
0
votes
1 answer

Creating multiple POSIXlt dates with multiple timezones in R

Well, first things first, I'm still a noob and am learning R. I've a a dataset with 0.9 million rows and 36 columns. Of these columns, a column, let's say DATE has dates in string format and an other column, let's say TZ has timezones as strings…
0xts
  • 2,411
  • 8
  • 16
0
votes
1 answer

extracting month and year from object of POSIX Dates and Times Classes in r

I tried to extract month and year from an object of POSIXlt class, however, the returned month seemed to be one month earlier and the year did not seem correct either. My R code is as follows:
Ken
  • 1
0
votes
1 answer

error while plotting bar chart sales_per_day in a month w.r.t date in 2021_Jan

This is my previous data Jan_df=Jan %>% select("Updated_Date","Amount") %>% mutate(Date=parse_date_time(Jan$Updated_Date,"ymd_HMS",tz="")) %>% select(Date,Amount) %>% group_by(date(Date)) %>% …
0
votes
1 answer

R Error converting column from character to datetime

I want to use strptime to convert a column from character to date-time format in an R data.frame. This is how the data from the column look like (in total I have 294 obs.): > df$TimeStamp [1] "09.02.2021 22:07:06.008" "10.02.2021 12:30:49.835" …
xidelos
  • 37
  • 4
0
votes
1 answer

How to convert length of time to numeric in R?

I have a data frame with the amount of time it takes to do a lap and I'm trying to separate that into individual data frames for each driver. These time values look like this, being in minutes:seconds.milliseconds, except for the first lap which has…
Lachie
  • 1
0
votes
1 answer

Using R, as.POSIXct() returning NAs even though it was working before

I am using R. This worked for me a month ago, but now when I try to run it I get NA. I have tried changing the timezone and I still receive NA. I am not sure why I am getting this issue as.POSIXct("12:46 29-Nov-18",format = "%H:%M…
ehuang
  • 15
  • 3
0
votes
0 answers

R data.table overwriting column after grouping operation

After selection of rows with .SD[.N] I can't convert column because of different number of elements then there are : library(data.table) dane = structure(list(DATA_CZAS = c("2010-08-20 10:24:03", "2010-10-11 15:39:29", "2010-12-10 13:40:31",…
Qbik
  • 5,885
  • 14
  • 62
  • 93
0
votes
1 answer

not dealing properly with dates in R

I am trying to use selectByDate from openair package but got stuck in my second try I have A > A date x 23 1982-08-23 0.0 24 1982-08-24 0.0 25 1982-08-25 0.0 26 1982-08-26 9.3 27 1982-08-27 0.0 28 1982-08-28 0.2 29 1982-08-29 …
jpessoa
  • 1
  • 1
0
votes
1 answer

"Error in as.POSIXlt.numeric(value) : 'origin' must be supplied" When Trying To Add POSIXlt To Dataframe

I'm looking to write a script that can simply correct dates in a data frame (observations) that have two digit years to have four digits. I have all of the logic, but I get an error when I run this code: observations[1,"Datetime_UTC"] <-…
reisnern21
  • 107
  • 2
  • 9