Skip to content
Prev 388981 / 398506 Next

Converting characters back to Date and Time

On Tue, 31 Aug 2021, Eliza Botto writes:
If using a package is an option:

  library("datetimeutils")
  convert_date(c(43269.42, 43269.46, 43269.50), "excel")
  ## [1] "2018-06-18" "2018-06-18" "2018-06-18"

  convert_date(c(43269.42, 43269.46, 43269.50), "excel", fraction = TRUE)
  ## [1] "2018-06-18 10:04:48 CEST" "2018-06-18 11:02:24 CEST"
  ## [3] "2018-06-18 12:00:00 CEST"

Note that the times differ: the numbers are probably
not /displayed/ to full precision in R.

You may also want to search the archives of this list,
as this question has been discussed before.
Message-ID: <87y28g50kf.fsf@enricoschumann.net>
In-Reply-To: <AS8P194MB099979E9FD39C8A3705261579ACC9@AS8P194MB0999.EURP194.PROD.OUTLOOK.COM> (Eliza Botto's message of "Tue, 31 Aug 2021 20:26:01 +0000")