-----Original Message-----
From: Muhammad Subianto [mailto:subianto at gmail.com]
Sent: Wednesday, October 26, 2005 10:18 AM
To: R-help at stat.math.ethz.ch
Subject: [R] How to convert time to days
Dear all,
I have ran a simulation in R.
This simulation was running about at least two days.
Here is below the result some part of my code about time result.
I don't understand about
Start time: Mon Oct 24, 2005 at 04:23:01 PM
Finish time: Wed Oct 26, 2005 at 03:26:19 PM
Run time: 1.960625 secs.
This is about two seconds or one day and nine hours?
Then, how could I convert to 1 day, 23 hours, ? minutes, ? seconds.
Thanks you very much for any suggestions.
Best wishes, Muhammad Subianto
##############################################################
##################
> # Begin of program and timestamp:
> cat(format(begin.time <- Sys.time(), "%a %b %d %X %Y") ,"\n")
Mon Oct 24 04:23:01 PM 2005
> cat("Start time:", secs <- format(begin.time, "%X"), "\n")
> cat("Sys.time:", begin.time <- Sys.time(), '\n')
>
> # End of program and timestamp:
> cat("Sys.time:",end.time <- Sys.time(), '\n')
> cat("Run Time:",end.time-begin.time, 'secs.\n\n')
> cat("Finish time:", secs <- format(end.time, "%X"), "\n")
> cat(format(end.time <- Sys.time(), "%a %b %d %X %Y") ,"\n")
Wed Oct 26 03:26:19 PM 2005
+ " Start time:", secs <- format(begin.time, "%a %b %d, %Y at
%X"), "\n",
+ "Finish time:", secs <- format(end.time, "%a %b %d, %Y at
%X"), "\n",
+ " Run time:", end.time-begin.time, 'secs.\n\n')
Start time: Mon Oct 24, 2005 at 04:23:01 PM
Finish time: Wed Oct 26, 2005 at 03:26:19 PM
Run time: 1.960625 secs.
##############################################################
#############