How can I convert in Java
a POSIXct
date to a formatted date like "y-M-d"
. I've been looking around but I didn't found anything.
I read from a file these lines:
1398691820,517.0400,517.0400,517.0400,517.0400,56200
1398691870,517.1950,517.1950,516.8850,517.0350,2700
1398691920,516.2500,517.2050,516.2500,517.2050,5800
1398691980,515.6000,516.4408,515.6000,516.2800,7700
1398692044,515.4800,515.9700,515.4800,515.9200,5300
The first number of each line is a POSIXct
date and I need to convert it to y-M-d hour:min
.
I also have in the file the offset:
timezone:EDT
gmtoffset:-14400
Any help is very apreciated.
Thanks a lot.
Edit:
This the way to convert the date in R:
as.POSIXct(1398691820-1400*60, origin = '1970-01-01', tz='EST')