Hi William,
asking to the r-devel list I resolved the problem! It depends from the 
timezone (tz param) that I didn't specified and so R automatically uses 
my local time and considers also the daylight saving time (that comes at 
2:00 at my position).
As my dates are in solar time, I specified the time zone as "GMT" and it 
works!
Here a simple example:

df = data.frame(DateTime = c(
   '2016-12-21 10:34:54',
   '2016-12-21 11:04:54',
   '2016-12-21 11:34:54',
   '2016-03-27 02:05:50',
   '2016-03-27 02:35:50',
   '2016-12-21 12:04:54',
   '2016-12-21 12:34:54'
))


df$DateTime = as.POSIXlt(strptime(df$DateTime,
                                   format='%Y-%m-%d %H:%M:%S',
                                   tz='GMT'))

ord = order(as.numeric(strptime(df$DateTime, format='%Y-%m-%d %H:%M:%S', 
tz='GMT')))

df.ord = df[ord,1]
df.ord


        [[alternative HTML version deleted]]

______________________________________________
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