Displaying 20 results from an estimated 8000 matches similar to: "How to convert 3-digits hours"
2011 Apr 17
2
as.Date function error
Hi,
I have some problems with as.Date function.
After I applied as.Date for my data, "2010" changed to "2020" as below
Where am I wrong?
Thanks
Wonjae
> x=c("11/16/2010","11/17/2010","11/18/2010","11/19/2010")
> x=as.Date(x,"%m/%d/%y")
> x
[1] "2020-11-16" "2020-11-17" "2020-11-18"
2010 May 14
2
Add 1 week to date with hours included for subset
Forum,
I've got hourly data for roughly 5 months of time that I want to subset into
successive weeks. The first two elements of the dataset are
well.80.2$date[1]
>[1] 6/12/2000 2:00
>9256 Levels: 10/1/2001...
well.80.2$date[2]
>[1] 6/12/2000 3:00
>9256 Levels: 10/1/2001....
and so on until mid-october. I've been able to add 1 week the first element
with the following:
2007 Dec 14
3
How to convert Datetime numbers from Excel to POSIXt objects
Hi all,
I need to compare time series data files of different time formats. I
had no problems with text format using strptime.
But how can I convert datetime numbers from Excel (days since 30.12.1899
00:00:00) into POSIXt objects?
For example 29770.375 should be converted to "03.07.1981 09:00:00"
I tried the following code and encountered strange results:
t1-t0 gives 29770.33
2012 Oct 25
2
mean of a value of the last 2 hours
Hello,
I have a data frame somewhat like that:
myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert",
"Bert"), Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012
11:00"), Hunger=c(1,1,1,2,2,1) )
myframestime <- as.POSIXct (strptime(as.character(myframe$Timestamp),
2009 Nov 04
1
Convert H:MM:SS PM /AM into 24 HR syntax
I've got an array of times in H:MM:SS PM/AM format, e.g. "5:27:15 PM" (no leading zero), and I would like to convert them over to 24 HR syntax, e.g. HH:MM:SS.
If it matters, the times are from the Central Time zone.
Is there a command to convert the time to a 24HR format?
I tried the following:
ptime("5:27:15 PM", "%H:%M:%S")
[1] "2009-11-04
2009 Sep 22
3
how to convert character string with only month and year into date
Dear R helpers.
I am new to plotting time data using R.
wonder how to convert character time info into date in R.
I searched over the web but did not find answer.
the input character string is something like 03_1993 or 03-1993, so the
precision is at month level. I tried the following but failed.
#R code below.
strptime(c("03_1993"),"%m_%Y")
2006 Jan 04
1
produce hours greater than 23
Hy all,
I wish to use the date function to draw againt the lifetime of a motor.
This lifetime is given to me in Hours (it can go over 5000 hours)
I'm unable to find how to convert this lifetime value to something like %H:%M:%S because when R see 24H it says 1 day, i don't want that, i just want %H:%M:%S with a value of %H higher than 24...
for example:
i've got this value in hours:
2010 Oct 15
1
Dealing with Non-Standard Hours
A data set I obtained has the hours running from 01 through 24
rather than the conventional 00 through 23. My favorite, strptime,
balks at hour 24.
I thought it would be easy to correct but it must be too late on
Friday for my brain and caffeine isn't helping.
TIA for a hint,
Clint
--
Clint Bowman INTERNET: clint at ecy.wa.gov
Air Quality Modeler INTERNET: clint at math.utah.edu
2009 Jun 10
2
isolating Hour and minute form date and time
Hi everybody. I have a dataframe that contains a factor with the date
information in the format like in the example below:
"2009/05/12 11:22:31 AM"
I have been able to convert it to POSIXt using strptime
Now I want to print only the date as one vector and the time in another
vector but they must be real date and time classes so that i can use them in
calculations
to reconstruct my
2003 Sep 02
1
convert character to POSIXct
Dear list-members,
I would like to calculate the difference between two points in time. To convert a 'time (GMT)'-character with the format "1/1/1999 01:01:01" into an object of class "POSIXct"', I first use the strptime() as suggested in the details help(as.POSIXct).
e.g.
starttime<-strptime("1/1/1999 01:01:01",format="%d/%m/%Y %H:%M:%S")
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
2008 May 30
3
Strptime
Hi
This code should explain what I'm trying to do
> strptime("30-Jan-08", "%d-%b-%y")
[1] "2008-01-30"
>
> format(strptime("30-Jan-08", "%d-%b-%y") , "%b-%y")
[1] "Jan-08"
>
> strptime(format(strptime("30-Jan-08", "%d-%b-%y") , "%b-%y") ,
"%b-%y")
[1] NA
I have a
2007 Jan 08
1
Does strptime(...,tz="GMT") do anything?
Hi All
In trying to correlate some tide gauge data I need to deal with varying
timezones. From the documentation on strptime, it seemed that the tz
variable might have some effect on the conversion, but I'm not seeing an
effect.
> strptime("20061201 1:02 PST",format="%Y%m%d %H:%M",tz="PST")+0
[1] "2006-12-01 01:02:00 EST"
>
2007 Jun 12
1
Can strptime handle milliseconds or AM/PM?
I'm trying to proess date/time fields from files that were given to me to
analyze.
Any clues what I'm doing wrong with strptime? This seems to fail the same
way under Linux or Windows.
For ?strptime would it make sense to explain %OS3 somewhere besides the
Examples?
> # Why does %OS3 work here?
> format(Sys.time(), "%H:%M:%S")
[1] "16:45:19"
>
2020 Oct 31
2
strptime() keeps emitting warnings after establishing a handler with tryCatch()
Dear list members,
I have come about a peculiar behavior in R (4.0.2) which I would
describe as a bug.
On macOS, where `strptime()` raises a warning for invalid timezone
identifiers, the following code will continue to raise the original
warning with every subsequent call to `strptime()`:
```
# attach a handler for warnings for this call only:
tryCatch(strptime('2020-10-31 18:30', format
2020 Nov 01
0
strptime() keeps emitting warnings after establishing a handler with tryCatch()
Hello,
I cannot reproduce this behavior and, as documented, the posted code
doesn't issue warnings due to a wrong timezone but I'm running
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK:
2011 Jul 06
1
trouble parsing a date using strptime()
Hi,
I am having a trouble parsing dates using strptime() that I get in the
format of year and week number. The data looks like this "201127" which
means year 2011 and week 27. I would like to graph this using ggplot but
then I get a gap between 201054 and 201101 so I thought I would just easily
convert it.
I tried to use strptime and as.Date and the format string of %Y%W but it
seems
2017 Jan 17
1
strptime("1","%m") returns NA
Hi Frederik,
On Mon, 2017-01-16 at 18:20 -0800, frederik at ofb.net wrote:
> Hi R Devel,
>
> I wrote some code which depends on 'strptime' being able to parse an
> incomplete date, like this:
>
> >
> > base::strptime("2016","%Y")
> [1] "2016-01-14 PST"
>
> The above works - although it's odd that it gives the month
2010 Feb 01
3
Convert a column of numbers to a column of strings
Hello,
Please excuse me if this question has been asked before. I'm new to R, and
have been trying to google the answers without any success.
I would like to convert a set of date and time into R date-time class. Right
now, the dates and times are in integer format, so I first need to convert
them into string, and then to R date-time using strptime. However, I have a
problem converting them
2016 Feb 04
3
Fwd: [musl] strptime() question
There is incompatibility between R strptime and musl libc. I posted
about it on their mailing list, but they need more information I can't
provide, so I'm forwarding the message here in hope R developers can
help. Thanks.
---------- Forwarded message ----------
From: Rich Felker <dalias at libc.org>
Date: Thu, Feb 4, 2016 at 2:07 PM
Subject: Re: [musl] strptime() question
To: Alba