Displaying 20 results from an estimated 10000 matches similar to: "Date format"
2007 Jan 17
2
problem with unlist POSIX date at midnight
Dear R-users,
I use unlist of POSIX dates to extract the year, hour etc. With that I
can search for files in my database which are in the form
'yyyymmddhh_synops.txt'
However, I get stucked during midnight where unlist just gives NA's.
The script is given below, the problem accurs at acc.period[16]
(midnight). However when I write out the character, unlist works well.
But
2016 Apr 11
0
Query about use of format in strptime
Hi Stefano,
As the help page says:
"The default for the format methods is "%Y-%m-%d %H:%M:%S" if any
element has a time component which is not midnight, and "%Y-%m-%d"
otherwise. This is because when the result is printed, it uses the
default format. If you want a specified output representation:
format(strptime(init_day, format="%Y-%m-%d-%H-%M"),"%Y-%M-%d
2004 Oct 28
2
POSIX time anomaly (PR#7317)
Full_Name: Allen McIntosh
Version: 2.0.0
OS: RedHat 9.0
Submission from: (NULL) (67.80.175.118)
The POSIX time printing routine gives strange results when asked to print a time
that is exactly midnight:
TZ=CST6CDT R -q --no-save
> strptime("10/5/2004 00:00:01 CDT", "%m/%d/%Y %H:%M:%S %Z")
[1] "2004-10-05 00:00:01"
> strptime("10/5/2004 00:00:00
2009 Oct 05
6
Date-Time-Stamp input method for user-specific formats
Date-Time-Stamp input method to correctly interpret user-specific
formats:coding is 90% there - based on exmple at
http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html
...anyone got the last 10% please?
CONTEXT:
Data is received where one of the columns is a datetimestamp. At midnight,
the value represented as text in this column consists of just the date part,
e.g.
2016 Apr 11
2
Query about use of format in strptime
Dear Jim and dear Enrico,
thank you for your replies.
Unfortunately your hints didn't solve my problem, and I am getting mad.
Can I show you my whole process? I will be as quick as possible.
I start from a data frame called Snow of the form
year month day hh mm hs
2007 11 19 0 0 0.00
2007 11 19 0 30 0.00
2007 11 19 1 0 0.00
2007 11 19 1 30 0.00
2007 11 19 2 0 0.00
2007 11 19 2 30 0.00
2007 11
2016 Apr 11
3
Query about use of format in strptime
Dear R-list users,
I need to use strptime because I have to deal with date with hours and minutes.
I read the manual for strptime and I also looked at many examples, but when I try to apply it to my code, I always encounter some problems.
I try to change the default format, with no success. Why? How can I change the format?
1.
init_day <- as.factor("2015-02-24-00-30")
2010 Jul 13
1
Time Variable and Historical Interest Rates
Guys, I wrote to the finance mailing list earlier with my questions but was
directed here.
Sorry for the repeat.
---------------
library(quantmod)
....
now <- Sys.time()
midnight <- strptime() # <---- I want to make this a static variable
that will be equal to 12:00:00 am but I dont know what to put here. I keep
getting NA for everything I do
if(now == midnight) {
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"
2012 Jul 13
1
read mignight as 24:00 and not as 0:00
Dear all,
I have dataset which contains date and time in the format
"yearmonthdayhour". I can read in these data correctly as follows:
mydata <- read.csv("pm10_corine_gridcel_hourly_2011.csv", header = TRUE)
mydata$date <- as.POSIXct(strptime(mydata$date, format = "%Y%m%d%H",
tz="UTC"))
However, midnight is defined as 24:00 in my original file (so
2001 Mar 21
1
convert date/time to numeric
Hi,
I convert a numeric value to date/time format and do
some operations on it. How to convert it back to a
numeric value?
Thanks,
Yu-Ling Wu
==================================================
begin <- 200103131030
EndTime <- strptime(paste(begin), format="%Y%m%d%H%M")
+ 60
end <- ????
(I want end=200103131031 instead of "2001-03-13
10:31:00")
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
2008 Aug 14
1
time difference bug?
Hi,
I am computing some time differences.
Using the linux version of R 2.7.1
And I am getting a strange result ( see below )
I need the difference in minutes.
Actually looking for where it is NOT 15 minutes.
Would anyone know why this could be happening?
Or should I do this another way?
Bill
The script "k0.R"
===============
a=read.table("buzwah005.txt")
2011 Sep 22
2
Problems with as.POSIXct
Hi R users:
This is a very strange problem:
Why this instruction shows me NA?,
and any other date shows me that error!
as.POSIXct(strptime("1992-5-3",format="%Y-%m-%d"))
This is my R version on windows 7.
"R version 2.13.1 Patched (2011-08-25 r56794)"
Thank you for your help.
2006 May 30
3
Time rather than dates?
Using strptime() and other functions for dates has been very helpful with
the kind of data I often work with. However, I haven't found out how time
as such should be specified. All my attempts result in time *and* date:
>treatment_time<-c("01:02:03","02:03:04") # hours:minutes:seconds
>time.2<-strptime(treatment_time,format="%H:%M:%S")
>time.2
[1]
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
2009 Jan 22
2
time date stamp since, january 1st 1970
Hello, we are receiving some data, sample below - with a weird time/date
stamp format, we need some help with R on converting this time date
stamp to a useable field in R, date and time in a data-frame. The
developer says its the number of milliseconds since midnight, January 1,
1970.
sample: *1232558018624*
---------------------
How do I interpret the time stamp? Is there a date, i need
2004 Jul 29
3
2 questions : format and hh:mm
Dear R-users,
i have two questions :
1- first of all, i wish to know the way to obtain a serie with a format
like "00" : ( "01","02","03","04"....) or like postal code
("01100","02222").
for instance, i do :
> format(strptime(as.character(c(1:4)),"%H"),"%H")
but it sounds complicate and not really
2001 Mar 07
3
export graph to Word/Excel
Hi,
I have a set of script like this:
----------------------
summary(data)
plot(time, users, type="o", xlab ="Time", ylab="Number
of Users")
----------------------
I type "rterm --slave < script.r > output.doc" and the
graphic doesn't
actually in the output.doc file. How to make the
graphic embedded in Word
or Excel file?
Thanks,
Yu-Ling Wu
2013 Mar 22
3
Double condition
Hi,
I would appreciate if somebody could help me with this small issue...
I have a dataframe like this (originaly has more than 100 000 rows):
> subz
jul time dtime fix ddawn ddusk day
101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1
101609 15006 2011-02-01 19:24:49 19.41361 midnight 7.916667 19.56667 1
101610 15006 2011-02-01
2006 Apr 10
3
timeAlign
I use POSIXct for datetimes. Is thee a timeAlign function that I can
use where :
align by year
direction -1 ==> start of this year
direction 1 ==> start of next year
align by week
direction -1 ==> date on last sunday
direction 1 ==> date on next sunday
align by day
direction -1 ==> time at past midnight
direction 1 ==> time at this comming