Skip to content

Instantly share code, notes, and snippets.

View jialinxie's full-sized avatar
🏠
Working from home

jialin jialinxie

🏠
Working from home
  • BYD Auto
  • China,Shenzhen
View GitHub Profile
@jialinxie
jialinxie / DayTime.java
Created August 5, 2017 03:43 — forked from junlincao/DayTime.java
根据经纬度计算日出与日落时间
/**
* 根据经纬度计算日出日落时间
* @param lat 纬度
* @param lng 经度
* @param isSunRise true计算日出,false计算日落
* @return int[] 0位置为小时,1位置为分钟
*/
public static int[] getDayTime(double lat, double lng, boolean isSunRise){
lat = Math.toRadians(lat);