AM/PM Distinction when formatting datetime field from sqlite into datetime field in R -


i have pulled data sqlite table r. 1 of columns string, datatime in sqlite. in following format:

                  time_json         number 1    2013-07-08 01:06:02              6 2    2013-07-08 01:08:01              6 3    2013-07-08 01:12:01              6 4    2013-07-08 01:14:01              6 5    2013-07-08 01:16:01              6 

i need format time_json field proper date time in r, , account am/pm distinction. nothing i've tried works.

thanks kindly.

this seems work, using formats listed in ?strptime:

test <- c("2013-07-08 01:06:02 am", "2013-07-08 01:06:02 pm")  as.posixct(   test,   format="%y-%m-%d %i:%m:%s %p" ) 

result:

[1] "2013-07-08 01:06:02 est" "2013-07-08 13:06:02 est" 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -