0

I am getting a Linux timestamp and then I am using POSIXct function in R to get date and time information. In case of linux timestamp how can i remove date information? Basically i want to convert 1421560227 to a number X such that when i run POSIXct function on X it will return "22:50:27".

Thanks

> dates=as.POSIXct(1421560227, origin="1970-01-01")
> dates
[1] "2015-01-17 22:50:27 MST"
user2543622
  • 5,760
  • 25
  • 91
  • 159
  • i dont think it is a duplicate because the post that you have mentioned doesnt show how to get X that is I am looking for. The post is mainly about extracting time from the timestamp. But I am not interested in that. I want to change linux timestamp itself – user2543622 Jan 22 '15 at 22:45
  • 1
    You can't have a `POSIXct` class object without a date component, which is why it is a *datetime* class and not a *time* class - this is true regardless of your operating system. Possible workarounds are discussed in the cited duplicate question, and probably in a handful of other similar questions on SO. – nrussell Jan 22 '15 at 22:51

0 Answers0