Unify gmtime and localtime code

Apparently gmtime was already implemented when I made localtime, so we had two different things written from scratch. We decided in the relibc channel of the Redox OS Mattermost chat to use my code, as it is more extensively tested and perhaps is clearer in how it works.
This commit is contained in:
jD91mZM2
2018-09-05 15:48:30 +02:00
parent 9cb594dca1
commit eb6ddac1eb
4 changed files with 21 additions and 91 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
int main() {
int day = 60 * 60 * 24;
time_t inputs[] = { -(day * 33), -day, -500, 0, 1531454950 };
for (int i = 0; i < 5; i += 1) {
time_t inputs[] = { -(day * 33), -day, -1, -500, 0, 1, 1531454950 };
for (int i = 0; i < (sizeof(inputs) / sizeof(time_t)); i += 1) {
struct tm* t = localtime(&inputs[i]);
printf(