date - convert from posix timestamp in %Y-%m-%d in R -


I have the date in this format:

  1397758632   

and I need to convert these formats into these dates% Y-% m-% d How can I do this? My timezone is GTM. Using the .POSIXct () function:

  as.POSIXct (x = "1397758632", original = "1960-01-01", tz = "GMT ")   

I have this error

  as error. POSIXlt.character (x, tz, ...): Character string is not in standard denial format   

How do I get a readable data?

Some things if you defined a variable x = "1397758632" You do not need to declare it again, just use x for example, // as.POSIXct (x, origin = "1970-01-01" , tz = "GMT")

2, x = "1397758632" / code> is actually a variable variable, try str (x) You want to declare it numerically, x = 1397758632 and you're all good.

Finally, to add as.Date () if you just want a date and do not stamp full time.

Then something like this:
x = 1397758632 POSIXct (x, origin = "1970-01-01", tz = "GMT") as.Date (as.POSIXct (x, origin = "1970-01-01", tz = "GMT")) #date only

Comments

Popular posts from this blog

c# - Wcf first request is slow? Solution on service? -

c# - Show a huge number of data in DevExpress GridView -

c - What are pthread cancelation points used for? -