mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
In __libnx_gtod() set tv_usec, and moved+updated the timezones comment.
This commit is contained in:
parent
842ce50c2f
commit
0dcaeec959
@ -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;
|
||||
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user