mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
fix: simplify rfc339 function
This commit is contained in:
parent
3814d43865
commit
8f4216be68
@ -41,9 +41,7 @@ export function fromRfc3339(str: string): Date {
|
||||
const tzOffset = tzOffsetSign * (tzOffsetHours * 60 + tzOffsetMinutes) * 60; // seconds
|
||||
|
||||
const date = new Date();
|
||||
date.setUTCFullYear(year);
|
||||
date.setUTCMonth(month - 1);
|
||||
date.setUTCDate(day);
|
||||
date.setUTCFullYear(year, month - 1, day);
|
||||
date.setUTCHours(hour, minute, second, milliSeconds);
|
||||
|
||||
return new Date(date.getTime() - tzOffset * 1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user