Skip to content

Commit 9e2f7cc

Browse files
authored
Use an int for fractional seconds (#1449)
1 parent 1d55a1f commit 9e2f7cc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2026-01-21 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/date_datetime/Datetime.h: Fractional seconds type
4+
switched to 'int' for consistency, print format string re-adjusted
5+
16
2026-01-20 Dirk Eddelbuettel <edd@debian.org>
27

38
* inst/include/Rcpp/date_datetime/Datetime.h (format): Correct a

inst/include/Rcpp/date_datetime/Datetime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace Rcpp {
7979
if (res == 0) {
8080
return std::string("");
8181
} else {
82-
res = ::snprintf(txtsec, 63, "%s.%06u", txtiso, m_us);
82+
res = ::snprintf(txtsec, 63, "%s.%06d", txtiso, m_us);
8383
if (res <= 0) {
8484
return std::string("");
8585
} else {
@@ -93,7 +93,7 @@ namespace Rcpp {
9393
private:
9494
double m_dt; // fractional seconds since epoch
9595
struct tm m_tm; // standard time representation
96-
unsigned int m_us; // microsecond (to complement m_tm)
96+
int m_us; // microsecond (to complement m_tm)
9797

9898
// update m_tm based on m_dt
9999
void update_tm() {

0 commit comments

Comments
 (0)