Print

Print


@amadio commented on this pull request.



>        ltm.tm_year += 100;
+   // In case GeneralizedTime is used
+   if (ltm.tm_year > 2000)
+      ltm.tm_year -= 1900;

In the end, I think this is what would give the most reasonable answers:

```cpp
   if (ltm.tm_year < 50)
      ltm.tm_year += 2000;
   else if (ltm.tm_year < 100)
      ltm.tm_year += 1900;

   ltm.tm_year -= 1900;
```
This works for years 00(2000) 01(2001) 49(2049) 51(1951) 1800 1900 1949 1951 2000, and 2100 without wrapping into 3000+.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1970#discussion_r1143626703
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1