Dear Friends, I’ve just started using R. I am working on a database
containing date-time as well as numeric values. Firstly I have changed the
class of the data/time column from factor to POSIXlt. Time and date are
based on UTC time but I need to change them to a local time ( not my local
time, my zone is Singapore but the data are from Australia) so I need to
change the time and date to Australia time say e.g AEST. I tried one way or
another but all failed. The following is example of the command I used.
Also one of my .CSV files is attached.

Data_Power <- read.table("train15.csv",header = TRUE, sep = ",", row.names
= NULL);

Date_clm=Data_Power$TIMESTAMP;

Date_original <- strptime(Date_clm, "%Y %m %d %H:%M", tz="GMT")

Date_local =format(Date_original, format="%c", tz="America/New_York")

Date_local <- strptime(Date_original, "%Y %m %d %H:%M +0800")

Date_local=as.POSIXlt(Date_original, "Australia/Darwin")

Date_local=as.POSIXlt(Date_original, " AEST ")

I would be so thankful if you help me out. Thanks



Cheers,

Faranak
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to