[R] How to convert time to days

From: Muhammad Subianto <subianto_at_gmail.com>
Date: Thu 27 Oct 2005 - 00:18:13 EST


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.

>

###########################################################################

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Oct 27 00:29:19 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:47 EST