cell offset -> day offset
519110
function cellOffsetToDayOffset(cellOffset) {
		var day0 = t.visStart.getDay(); // first date's day of week
		cellOffset += dayToCellMap[day0]; // normlize cellOffset to beginning-of-week
		return Math.floor(cellOffset / cellsPerWeek) * 7 // # of days from full weeks
			+ cellToDayMap[ // # of days from partial last week
				(cellOffset % cellsPerWeek + cellsPerWeek) % cellsPerWeek // crazy math to handle negative cellOffsets
			]
			- day0; // adjustment for beginning-of-week normalization
	}
1314895
function OffsetDate($dayFraction, $date=false)
	{
		if (!$date) {
			$date = $this->sysDate;
		}

		$fraction = $dayFraction * 24 * 3600;
		return $date . ' + INTERVAL ' .	$fraction . ' SECOND';
//		return "from_unixtime(unix_timestamp($date)+$fraction)";
	}
965005
def _offset_dt(cls, dt, offset_str):
        
        match = cls._offset_pattern.match(offset_str)
        if match is None:
            raise ValueError(
                "'%s' is not a valid offset string" % offset_str
            )
        sign, hours_str, minutes_str = match.groups()
        sign_factor = -1 if sign == '+' else 1
        hours = int(hours_str) * sign_factor
        minutes = int(minutes_str) * sign_factor
        td = timedelta(hours=hours, minutes=minutes)
        return dt + td
987088
function(inst, offset, period) {
		var year = inst.drawYear + (period === "Y" ? offset : 0),
			month = inst.drawMonth + (period === "M" ? offset : 0),
			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));

		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		if (period === "M" || period === "Y") {
			this._notifyChange(inst);
		}
	}
719173
function(node) {
    if (node) {
        this.start = {
            line: node.start.line,
            column: node.start.column
        };
        this.end = {
            line: node.end.line,
            column: node.end.column
        };
        this.offset = {
            start: node.start.offset,
            end: node.end.offset
        };
    }
}
677526
private static int dayToUtilDay(int day) {
        switch (day) {
            case EventRecurrence.SU: return Calendar.SUNDAY;
            case EventRecurrence.MO: return Calendar.MONDAY;
            case EventRecurrence.TU: return Calendar.TUESDAY;
            case EventRecurrence.WE: return Calendar.WEDNESDAY;
            case EventRecurrence.TH: return Calendar.THURSDAY;
            case EventRecurrence.FR: return Calendar.FRIDAY;
            case EventRecurrence.SA: return Calendar.SATURDAY;
            default: throw new IllegalArgumentException("bad day argument: " + day);
        }
    }
1106112
def dateAt(self, x):
        
        gantt       = self.ganttWidget()
        dstart      = gantt.dateStart()
        days        = int(x / float(gantt.cellWidth()))
        
        return dstart.addDays(days)
654518
function _offsetPos(pos, offset) {
        return {line: pos.line, ch: pos.ch + offset};
    }
449322
function (cell) {
            try {
                var start = domUtils.getXY(cell).x + cell.offsetWidth,
                    rows = this.table.rows, cells , returns = [];
                for (var i = 0; i < this.rowsNum; i++) {
                    cells = rows[i].cells;
                    for (var j = 0, tmpCell; tmpCell = cells[j++];) {
                        var tmpStart = domUtils.getXY(tmpCell).x;
                        if (tmpStart > start) break;
                        if (tmpStart == start && tmpCell.colSpan == 1) {
                            returns.push(tmpCell);
                            break;
                        }
                    }
                }
                return returns;
            } catch (e) {
                showError(e);
            }
        }
64504
function cellToDate() {
		var cellOffset = cellToCellOffset.apply(null, arguments);
		var dayOffset = cellOffsetToDayOffset(cellOffset);
		var date = dayOffsetToDate(dayOffset);
		return date;
	}
524784
def _apply_offset(self, offset):
        
        if not isinstance(offset, TimeValue):
            self.log_exc(u"offset is not an instance of TimeValue", None, True, TypeError)
        self.log([u"Applying offset %s", offset])
        self.smflist.offset(offset)
639010
def add_offset(self, offset):
        
        self.timestamps = [ts + offset for ts in self.timestamps]
963644
function getOffset(offset) {

            var symbol = offset.charAt(0);
            var time = offset.substring(1).split(':');
            var hours = Number.parseInt(time[0], 10) * 60;
            var minutes = Number.parseInt(time[1], 10);
            var total = Number.parseInt(symbol + (hours + minutes));

            return total;

        }
149603
@Override
    public void getOffset(long date, boolean local, int[] offsets) {
        synchronized (javacal) {
            if (local) {
                int fields[] = new int[6];
                Grego.timeToFields(date, fields);
                int hour, min, sec, mil;
                int tmp = fields[5];
                mil = tmp % 1000;
                tmp /= 1000;
                sec = tmp % 60;
                tmp /= 60;
                min = tmp % 60;
                hour = tmp / 60;
                javacal.clear();
                javacal.set(fields[0], fields[1], fields[2], hour, min, sec);
                javacal.set(java.util.Calendar.MILLISECOND, mil);

                int doy1, hour1, min1, sec1, mil1;
                doy1 = javacal.get(java.util.Calendar.DAY_OF_YEAR);
                hour1 = javacal.get(java.util.Calendar.HOUR_OF_DAY);
                min1 = javacal.get(java.util.Calendar.MINUTE);
                sec1 = javacal.get(java.util.Calendar.SECOND);
                mil1 = javacal.get(java.util.Calendar.MILLISECOND);

                if (fields[4] != doy1 || hour != hour1 || min != min1 || sec != sec1 || mil != mil1) {
                    // Calendar field(s) were changed due to the adjustment for non-existing time
                    // Note: This code does not support non-existing local time at year boundary properly.
                    // But, it should work fine for real timezones.
                    int dayDelta = Math.abs(doy1 - fields[4]) > 1 ? 1 : doy1 - fields[4];
                    int delta = ((((dayDelta * 24) + hour1 - hour) * 60 + min1 - min) * 60 + sec1 - sec) * 1000 + mil1 - mil;

                    // In this case, we use the offsets before the transition
                   javacal.setTimeInMillis(javacal.getTimeInMillis() - delta - 1);
                }
            } else {
                javacal.setTimeInMillis(date);
            }
            offsets[0] = javacal.get(java.util.Calendar.ZONE_OFFSET);
            offsets[1] = javacal.get(java.util.Calendar.DST_OFFSET);
        }
    }
331629
function _calculateGridLatLonOffset(cellSize, latitude) {
  const yOffset = _calculateLatOffset(cellSize);
  const xOffset = _calculateLonOffset(latitude, cellSize);
  return {yOffset, xOffset};
}
1041875
public static DateTime offsetHour(Date date, int offset) {
		return offset(date, DateField.HOUR_OF_DAY, offset);
	}
774996
public static void setCellValueAsDate(Cell cell, Date date, boolean dateStart1904) {

        ArgUtils.notNull(cell, "cell");
        ArgUtils.notNull(date, "date");

        if(dateStart1904) {
            // 1904年始まりの場合は、そのまま設定する
            cell.setCellValue(date);

        } else {

            long timemills = date.getTime();
            if(timemills <= MILLISECONDS_19000101_END) {
                // 1900年1月0日の場合は、数値に変換してから設定する
                // タイムゾーンを除去する
                Date strip = new Date(date.getTime() + TimeZone.getDefault().getRawOffset());
                double num = ExcelDateUtils.convertExcelNumber(strip, dateStart1904);
                cell.setCellValue(num);

            } else {
                cell.setCellValue(date);
            }

        }

    }