Skip to content

Commit

Permalink
In __libnx_gtod() set tv_usec, and moved+updated the timezones comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
yellows8 committed Feb 21, 2018
1 parent 842ce50 commit 0dcaeec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nx/source/runtime/newlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static struct _reent* __libnx_get_reent(void) {
return tv->reent;
}

//TODO: timeGetCurrentTime() returns UTC time. How to handle timezones?

int __libnx_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz) {
if (tp != NULL) {
u64 now=0;
Expand All @@ -40,10 +42,10 @@ int __libnx_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz) {
}

tp->tv_sec = now;
tp->tv_usec = 0;//timeGetCurrentTime() only returns seconds.
tp->tv_usec = now*1000000;//timeGetCurrentTime() only returns seconds.
}

if (tz != NULL) {//TODO: This needs handled properly, timeGetCurrentTime() returns UTC time.
if (tz != NULL) {
tz->tz_minuteswest = 0;
tz->tz_dsttime = 0;
}
Expand Down

0 comments on commit 0dcaeec

Please sign in to comment.