Skip to content

Commit

Permalink
Add a comment in fromUnixTime (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
darktrojan authored Aug 26, 2022
1 parent a58925e commit 5df3565
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ical/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,9 @@
*/
fromUnixTime: function fromUnixTime(seconds) {
this.zone = ICAL.Timezone.utcTimezone;
// We could use `fromJSDate` here, but this is about twice as fast.
// We could also clone `epochTime` and use `adjust` for a more
// ical.js-centric approach, but this is about 100 times as fast.
var date = new Date(seconds * 1000);
this.year = date.getUTCFullYear();
this.month = date.getUTCMonth() + 1;
Expand Down

0 comments on commit 5df3565

Please sign in to comment.