Skip to content

Instantly share code, notes, and snippets.

@nulltask
Created January 17, 2017 17:02
Show Gist options
  • Select an option

  • Save nulltask/af067ca050c9e53b1b62e105bfa12b88 to your computer and use it in GitHub Desktop.

Select an option

Save nulltask/af067ca050c9e53b1b62e105bfa12b88 to your computer and use it in GitHub Desktop.

Revisions

  1. nulltask created this gist Jan 17, 2017.
    15 changes: 15 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    const SunCalc = require('suncalc');
    const moment = require('moment-timezone');

    const dates = ['2016-03-20', '2016-06-21', '2016-09-22', '2016-12-21'];

    dates.forEach((target) => {
    console.log('==========')
    for (let h = 0; h < 24; h++) {
    for (let m = 0; m < 60; m++) {
    const date = new Date(`${target} ${h}:${m}:0`);
    console.log(moment(date).tz('Asia/Tokyo').format(), SunCalc.getPosition(date, 34.649394, 135.001478).altitude);
    }
    }
    });
    5,764 changes: 5,764 additions & 0 deletions stdout.log
    5,764 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.