similar to: {round,trunc}.POSIXt and daylight savings time (PR#1543)

Displaying 20 results from an estimated 8000 matches similar to: "{round,trunc}.POSIXt and daylight savings time (PR#1543)"

2002 May 17
0
round.POSIXt gets certain values wrong
For certain values, round.POSIXt(tm,'day') does not round to midnight as documented. The reason is that trunc.POSIXt() does not adjust the value of the isdst element. Assuming my assessment of the reason is correct, I have a potential solution to offer. Additional discussion is in bug report #1543. -Don > x <- c(as.POSIXct('2001-4-1 3:15'),as.POSIXct('2001-5-2
2002 May 03
1
Daylight savings time and conversion to POSIXt (arghh!)
I have asked this question before, and received some suggestions for work-arounds that get the job done--and they are much appreciated. But I would still like to find out if I'm missing something, and whether there is a direct way using POSIXt functions (as.POSIXct, as.POSIXlt, strptime, in particular). I have environmental data collected once per minute. Here is a subset of 3 input
2010 Feb 01
1
Error with cut.POSIXt and daylight savings time switchover dates
The following code: cut(as.POSIXct("2009-11-01 04:00:00", tz="America/Los_Angeles"), "1 day") gives the error: Error in seq.int(0, to - from, by) : 'to' must be finite This is related to November 1st, 2009 being the switchover date from daylight savings time to standard time in the America/Los_Angeles time zone. In particular, in cut.POSIXt, the starting
2011 Mar 23
0
suggestions re trunc.POSIXt
Dear all, I hope this is a right place to post this; r-help might be appropriate but it looks like I'm suggesting a change in base package, so I decided to post here. (+ Apologies if that has been changed recently -- the version I'm using is R.2.12.2 on Windows.) I've noticed an unexpected behavior of trunc.POSIXt: foo <- seq(as.POSIXct( "2009-10-23 22:00:00"),
2003 Jun 17
0
A 'pretty' function for POSIXt objects
I have written a set of functions for POSIXt objects that I would like to offer for consideration for use in base R. They augment and extend existing functions. Briefly, ## pretty.ct function(x,specs=pretty.ct.specs) ## round.ct function(x, tstr='1 min' ) ## axis.ct function(side,x,specs=NULL,...) ## parse.timeint function(dv) ## parse.tstr
2012 Jul 02
1
Undocumented behavior around daylight savings time?
Apologies for the intrusion. I am a lurker on list. I have been working to convert a digitized signal from a matlab file into R for analysis and other applications. R.matlab is working fine, and it is easy to convert the matlab date-time number (days since year 0) into R date-time numbers (seconds since 1970-01-01). Unfortunately, when I cast the R date-time number into POSIXct format it seems
2006 Oct 27
2
POSIXct time zone and daylight savings issues
Hello, Suppose we need a function that takes a POSIXct object and need to calculate the time difference between it and GMT time: gmtDiff <- function(time) { time.gmt <- as.POSIXct(format(time, tz="GMT")) time.plt <- as.POSIXlt(time) dlstime <- ifelse(time.plt$isdst > 0, 1, 0) timezone <- as.numeric(difftime(time, time.gmt, units="hours"))
2007 Oct 30
1
timezone conversion difficulties with the new US daylight saving time switch over
I'm having difficulties with daylight saving times in US time zones. (Apologies for the long post, but the problem seems subtle and complex, unless I'm doing something completely wrong, in which case it should be evident from the first 10 lines below.) This is what I see, using a (slightly modified) example from ?as.POSIXlt : > as.POSIXlt((d <- Sys.time()), "EST5EDT") #
2003 Aug 04
0
as.POSIXct Bug when used with POSIXlt arg and tz= arg (PR#3646)
Tracking down this bug was joint work with Jermoe Asselin (jerome at hivnet.ubc.ca) and Patrick Connolly (p.connolly at hortresearch.co.nz). We collectively were able to determine that this is a problem in both Windows 2000 and in Linux and by testing it in our three time zones that it seems to be daylight savings time related. Conversion of POSIXlt datetimes to POSIXct appears to have problems.
2002 Mar 26
1
seq.POSIXt() with short time intervals
I was surprised when seq.POSIXt() returned a single value rather than a vector, from inputs that I thought were reasonable. Here's an example to illustrate: > t0 <- ISOdatetime(2002,6,24,0,0,10) ## expected a sequence of 16 times 1 second apart > seq.POSIXt(from=t0,to=t0+15,by='1 sec') [1] "2002-06-24 00:00:10 PDT" ## traces to this call >
2012 Sep 05
2
POSIXlt and daylight savings time
I have a data frame that contains dates, but when I use as.POSIXlt() I lose the hours on all records. I traced this down to a particuar hour which causes the issue... > as.POSIXlt('2004-10-31 02:00:00') [1] "2004-10-31" > as.POSIXlt('2004-10-31 03:00:00') [1] "2004-10-31 03:00:00" How do I tell as.POSIXlt() to ignore daylight savings and just convert to
2011 Feb 19
1
problem in plotting numeric x by POSIXt class with lattice
# hi all, # I'm trying to plot temperatures by date in a trellis plot by their stations # I'm plotting the following data.frame library(lattice) h <- structure(list(station_name = structure(c(3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L, 5L, 8L, 9L, 3L, 4L, 2L, 10L, 11L, 12L, 6L, 7L), .Label = c("Ashqelon", "Beer Sheva",
2006 Jan 06
1
Daylight Savings Time unknown in R-2.2.1
Under R-2.2.1, a POSIXlt date created with "strptime" has an unknown Daylight Savings Time flag: > strptime(20051208, "%Y%m%d")$isdst [1] -1 This is true on both Linux (details below) and Windows. It did not occur under R-2.1.0. Any ideas? TIA! > Sys.getenv("TZ") TZ "" Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu
2004 Mar 30
1
seq.POSIXt() bug not fixed in R 1.8.1 (PR#4558)
I am still experiencing problems with seq.POSIXt() missing off the last day of the series: > seq(as.POSIXct("2004-03-25"),as.POSIXct("2004-03-31"),by="DSTdays") [1] "2004-03-25 GMT Standard Time" "2004-03-26 GMT Standard Time" "2004-03-27 GMT Standard Time" [4] "2004-03-28 GMT Standard Time" "2004-03-29 GMT Daylight
2005 Jul 11
0
Sys.timzone() returns NA - problem caused by as.POSIXlt? (PR#8003)
This is not a bug in R: the documentation does say the result is OS-specific. `GMT' is a not a proper timezone on Windows, so NA is a valid answer. (Windows seems to use GMT to refer to the timezone of the UK, e.g. > Sys.time() [1] "2005-07-11 07:49:56 GMT Daylight Time" > Sys.timezone() [1] "GMT Daylight Time" although I am in British Summer Time not GMT.)
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
Full_Name: Petr Simecek Version: 2.5.1, 2.6.1 OS: Windows XP Submission from: (NULL) (195.113.231.2) Several times I have experienced that a length of a POSIXt vector has not been computed right. Example: tv<-structure(list(sec = c(50, 0, 55, 12, 2, 0, 37, NA, 17, 3, 31 ), min = c(1L, 10L, 11L, 15L, 16L, 18L, 18L, NA, 20L, 22L, 22L ), hour = c(12L, 12L, 12L, 12L, 12L, 12L, 12L, NA, 12L,
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time starts. If I type (on R 1.8.1 on Gentoo Linux) > ISOdatetime(2004,4,4,0:4,0,0,"GMT") [1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST" [3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST" [5] "2004-04-03 23:00:00 EST" Giving the times
2024 Feb 08
1
round.Date and trunc.Date not working / implemented
This is a workaround, and could be the basis for a round.Date improvement: date <- Sys.Date() as.Date(round(as.POSIXct(date), "years")) as.Date(round(as.POSIXct(Sys.Date() + 180), "years")) Duncan Murdoch On 08/02/2024 12:23 p.m., Henrik Bengtsson wrote: > Technically, there is a round() for 'Date' objects, but it doesn't > seem very useful,
2024 Feb 09
1
round.Date and trunc.Date not working / implemented
> This is a workaround, and could be the basis for a round.Date improvement: >?? date <- Sys.Date() >?? as.Date(round(as.POSIXct(date), "years")) >?? as.Date(round(as.POSIXct(Sys.Date() + 180), "years")) > Duncan Murdoch That would work, perhaps structured similarly as `trunc.Date` is. The only issue might be that `trunc.Date` is currently using
2002 Apr 08
1
Problem(?) in strptime()
I think the following examples illustrate the crux of the matter (version and OS info are below). The problem has to do with the transition from standard time to daylight savings time. My timezone, US/Pacific, has two parts: standard time (PST) 8 hours behind GMT and daylight savings time (PDT) 7 hours behind GMT. The transition takes place this year on 7 April at 02:00, when 02:00 is