similar to: date and time conversion

Displaying 20 results from an estimated 10000 matches similar to: "date and time conversion"

2012 May 02
3
factor conversion to date/time
Hi, I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. I've tried as.Date, as.POSIXlt and strptime the problem is that the database has put a T between the numbers and R will not accept any conversions. currently it sees the date as a factor with the format as 1981-01-02T08:00I would like to keep only the year and month, but my
2012 May 02
1
convert numbers into dates and time
Hi I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. the problem is that the database has put a T between the numbers and R will not accept any conversions. this is the format that it's in now 1981-01-02T08:00 can anyone help? cheers! -- View this message in context:
2006 Sep 01
3
Date conversion with as.POSIXct and as.POSIXlt (PR#9196)
Full_Name: Erich Neuwirth Version: 2.3.1 OS: Windows XP, Linux Submission from: (NULL) (131.130.135.167) Converting Sys.Date() to a POSIX compliant time type in different ways produces inconsistent results: > Sys.date() [1] "2006-09-01" > as.POSIXct(Sys.Date()) [1] "2006-09-01 02:00:00 CEST" > as.POSIXlt(Sys.Date()) [1] "2006-09-01" >
2006 Nov 27
2
as.Date: conversion pb from POSIXct (PR#9386)
Full_Name: Xiao Gang FAN Version: 2.4.0 OS: Windows Submission from: (NULL) (159.50.101.9) > library(chron) > as.Date(as.POSIXct(strptime("1994-01-24","%Y-%m-%d"))) [1] "1994-01-23"
2013 Jan 11
1
Date time conversion bug (as.POSIXct)?
There is something wrong, I think, with the date-time conversion from a numeric value if you use Central European Time (CET) as timezone. Examples from R: If I use the GMT time zone it is OK, I get the same time back from as.POSIXct as I entered > as.POSIXct(as.numeric(strptime("30/01/2012 13:00:00", format="%d/%m/%Y >
2008 Jul 03
1
'as.Date' conversion of classes POSIX*t (problem/feature)?
Hi, I'm working with objects of classes "Date","POSIXlt" and "POSIXct" and still having some Date/Time-related concepts unclear. In the documentation of "as.Date" one can find: "The 'as.Date' methods accept ... '"POSIXlt"' and '"POSIXct"'. (The last are converted to days by ignoring the time after
2006 Aug 11
1
more on date conversion differences in 2.2.1 vs 2.3.1
With dates I get different results with 2.2.1 and 2.3.1. From my somewhat naive point point of view, the 2.2.1 behaviour seems more sensible. Running the code below in 2.2.1: V1 2006-08-01 2006-08-01 1 1 With 2.3.1 I get: V1 1154354400 1154440800 1 1 # testdate.R t <- read.csv2('testdate.csv', header=FALSE) t$V1 <- as.POSIXct(t$V1)
2009 Oct 21
1
date conversion not as i would have expected
Good day, i imported some data into R from Excel. By using the edit() function, this is what one of the dates looks like in R: > x <- structure(1254351600, class = c("POSIXt", "POSIXct"), tzone = "") [1] "2009-10-01 BST" However, when i do the following, the date changes: > as.Date(x, formate="%Y-%m-%d" ) [1] "2009-09-30" I
2004 Feb 04
5
Date Time Conversion problems...
At one time (version 1.7), the code below used to work for converting and extracting based on the Date Time. In version 1.8.1, something changed I know, but I cannot for the life of me figure out what... Data: UserName,RequestDate,PO,OrderDate,ExpDelivDate,Vendor,Total "Woody, Jim",12/19/2002,AP15063,1/7/2003,2/10/2003,Ames ,8570 "Harrold,
2014 Jul 09
4
Conversion date a numeric y vuelta a date
Hola a todos: Debe de ser una tonterĂ­a, pero no consigo saber porque la siguiente linea no devuelve la fecha actual: as.Date(as.numeric(Sys.time())) He hecho esa prueba porque no consigo pasar un numero convertido a partir de una fecha y modificado a fecha de nuevo. Gracias por adelantado. Un saludo, Alberto. [[alternative HTML version deleted]]
2012 Mar 30
1
lubridate:ymd_hm and coercion of class POSIXct. Smooth way to restore the date format.
Dear all, I wish to create a POSIXct variable from date and time variables using the ymd_hm function in package lubridate. In some cases data for time is missing, which causes a problem for ymd_hm. I wish to find a smooth way to handle this. # Some example data: x <- data.frame(date = c("2011-09-22", "2011-07-28"), time = c("15:00", NA)) x # paste date and
2013 Aug 25
3
POSIXct bug for conversion of specific combinations of date and time
Hello everyone, I'm having a big trouble with which seems to be a bug in as.POSIXct() date-time conversion. I have massive GPS datasets in which each location has it's own date and time attribute. As I convert them to POSIXct format, 1300 cases (of about half a million locations) simply return NA values. I picked up a small sample of failed cases and normal cases to demonstrate the
2010 Mar 17
3
Date conversion issue
I am parsing dates as follows: > z[1:10,1:3] V1 V2 V3 1 0 03/02/09 22:20:51.274 2 100 03/02/09 22:28:18.801 3 200 03/02/09 22:33:33.762 4 300 03/02/09 22:40:21.826 5 400 03/02/09 22:41:38.361 6 500 03/02/09 22:42:50.882 7 600 03/02/09 22:45:19.885 8 700 03/02/09 22:48:55.558 9 800 03/02/09 22:51:21.112 10 900 03/02/09 22:58:41.860
2006 Aug 07
1
unwanted conversion of date formats in 2.3.1 to character
good morning I'm using R 2.2.1 on windows (2000/NT/XP) and trying to upgrade to 2.3.1 I am finding the curious problem of date/time data (both if stocked as date and as POSIX) that gets converted into character format whenever touched: it seems that date/time data just does not want to remain that way. For example, a data.frame containing dates or POSIXct as row.names that is returned as
2008 Jul 09
4
Strptime/ date time classes
Dear all, I've come across a problem using strptime, can anyone explain what's going on? I'm using version 2.7.0 on Windows XP. Thank you Caroline First read in a data file using read.table alldata = read.table(file, header=F, skip=4, colClasses = c("character","numeric")) dim(alldata) [1] 223960 2 # inefficient, safe way of sorting out missing or dodgy
2003 Jun 05
1
question about POSIXct conversion
Hello! I am trying to compute minimal time on some data like this: mt<-tapply(mrsh$time1,list(mrsh$var1,mrsh$var2),min): a b 145 1054800600 1054789800 340 1054804500 1054794600 349 1054820400 1054792800 55 1054800600 1054789200 57 1054814100 1054791000 78 1054822200 1054790400 843
2012 Jun 15
2
time zones and the chron to POSIXct conversion
Hey R folks, i found some strange (to me) behaviour with chron to POSIXct conversion. The two lines of code result in two different results, on ewith the correct time zone, one without: library(chron) as.POSIXct(chron('12/12/2000'), tz = 'UTC') as.POSIXlt(chron('12/12/2000'), tz = 'UTC') Only the code below would give me a POSIXct object with the correct time
2006 Feb 21
3
Number of Days Between Dates: Incorrect Results For Date Calucations.
In some cases, incorrect results are produced by the code below intended to calculate the number of days between 2 dates. The year in question was a leap year. Note the results for 2004-04-04 and 2004-04-05 are the same! They should be 37 and 38 respectively. > as.integer(as.POSIXct("2004-04-02") - as.POSIXct("2004-02-27")) [1] 35 >
2009 Aug 30
2
POSIX time conversion doesn't display digit
Hi, I have the following string that I converted to a POSIXct: > a <- "2009-08-24 10:00:00.213" > a.p <- strptime(a,"%Y-%m-%d %H:%M:%OS") > as.double(as.POSIXct(a.p)) [1] 1251122400 I can't seem to get the decimal fraction of .213 out by casting to double or numeric. Is there anyway to make sure that POSIXct spits that out? Thank you. adschai
2018 May 16
2
Date method of as.POSIXct does not respect tz
R 3.5.0 Is it intended that the Date method of as.POSIXct does not respect the tz parameter? I suggest changing as.POSIXct.Date to this: function (x, tz = "", ...) .POSIXct(unclass(x) * 86400, tz = tz) Currently, the best workaround seems to be using the character method if one doesn't want the default timezone (which is often an annoying DST timezone). This came up on