[R] How to convert time to days
Muhammad Subianto
subianto at gmail.com
Wed Oct 26 16:18:13 CEST 2005
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")
Start time: 04:23:01 PM
> cat("Sys.time:", begin.time <- Sys.time(), '\n')
Sys.time: 1130163781
>
>
--- CODE SIMULATION ---
>
> # End of program and timestamp:
> cat("Sys.time:",end.time <- Sys.time(), '\n')
Sys.time: 1130333179
> cat("Run Time:",end.time-begin.time, 'secs.\n\n')
Run Time: 1.960625 secs.
> cat("Finish time:", secs <- format(end.time, "%X"), "\n")
Finish time: 03:26:19 PM
> cat(format(end.time <- Sys.time(), "%a %b %d %X %Y") ,"\n")
Wed Oct 26 03:26:19 PM 2005
>
> cat("\n",
+ " 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.
>
###########################################################################
More information about the R-help
mailing list