/** * 获取角度 */mapNumberUtil.getAngle = function(lng_a,lat_a, lng_b, lat_b){ var a = (90 - lat_b) * Math.PI / 180; var b = (90 - lat_a) * Math.PI / 180; var AOC_BOC = (lng_b - lng_a) * Math.PI / 180; var cosc = Math.cos(a) * Math.cos(b) + Math.sin(a) *…
<script> function getRemainderTime (startTime){ var s1 = new Date(startTime.replace(/-/g, "/")), s2 = new Date(), runTime = parseInt((s2.getTime() - s1.getTime()) / 1000); var year = Math.floor(runTime / 86400 / 365); runTime = runTime % (…
时间戳转换为时间 // 时间戳转换为时间 function timestampToTime(timestamp, isMs = true) { const date = new Date(timestamp * (isMs ? 1 : 1000)) return `${date.getFullYear()}-${date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1}-${date.getDate(…
IOS 计算两个经纬度之间的距离 一 丶 -(double)distanceBetweenOrderBy:(double) lat1 :(double) lat2 :(double) lng1 :(double) lng2{ CLLocation *curLocation = [[CLLocation alloc] initWithLatitude:lat1 longitude:lng1]; CLLocation *otherLocation = [[CLLocation alloc] init…
1.前期需求,两个日期,我们叫他startDate和endDate,然后获取到两个日期之间的日期 /** * 获取两个日期之间的日期 * @param start 开始日期 * @param end 结束日期 * @return 日期集合 */ private List<Date> getBetweenDates(Date start, Date end) { List<Date> result = new ArrayList<Date>(); Calendar tem…
## 获取两个时间之间的间距时间 $s = '2017-02-05'; $e = '2017-07-20'; $start = new \DateTime($s); $end = new \DateTime($e); // 时间间距 这里设置的是一个月 $interval = \DateInterval::createFromDateString('1 month'); $period = new \DatePeriod($start, $interval, $end); foreach ($p…
前言:直接上代码 java 获取两个日期之间的所有日期(年月日) /** * 获取两个日期之间的日期,包括开始结束日期 * @param start 开始日期 * @param end 结束日期 * @return 日期集合 */ private List<Date> getBetweenDates(Date start, Date end) { List<Date> result = new ArrayList<Date>(); Calendar tempStart…
一:C# 获取两个时间段之间的所有时间 public List<string> GetTimeList(string rq1, string rq2) { List<string> timeList = new List<string>(); //首先保证 rq1<=rq2 DateTime time1 = Convert.ToDateTime(rq1); DateTime time2 = Convert.ToDateTime(rq2); while (time1…
/*计算两个经纬度之间的距离 结果单位:米 */public static double getDistance(String lat1Str, String lng1Str, String lat2Str, String lng2Str) { Double lat1 = Double.parseDouble(lat1Str); Double lng1 = Double.parseDouble(lng1Str); Double lat2 = Double.parseDouble(lat2Str)…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-…