time - R strptime() still returns NA when locale is English_United States.1252 -


my time dataset hourlyload.csv$localdatetime like:

07nov10:12:45:00 07nov10:13:00:00 07nov10:13:15:00 07nov10:13:30:00  

i'm trying convert string date numeric date, subset data starting date 2013-01-01 , end dates 2015-09-31.

i tried

x<- strptime(hourlyload.csv$localdatetime, format="%d/%b/%y:%h:%m:%s",tz="america/los_angeles") 

but x returns na

i checked locale, , it's english_united states.1252. don't think na caused non-english locale.

i tried as.posixct(), as.date...none of them work.

use

sys.setlocale("lc_all","english") sys.setlocale("lc_time", "english") strptime("07nov10:12:45:00", format="%d%h%y:%h:%m:%s",tz="america/los_angeles")  [1] "2010-11-07 12:45:00 pst" 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -