'use strict'

const { subMilliseconds, subHours, subDays, subMonths, subYears, startOfHour, startOfDay, startOfMonth, startOfYear } = require('date-fns')
const serverTimeZone = require('./timeZone')

module.exports = (userTimeZone = serverTimeZone) => {

	const utcDate = Date.now()

	return {
		userTimeZone,
		// Get a date with an offset
		lastMilliseconds: (milliseconds) => subMilliseconds(utcDate, milliseconds),
		lastHours: (hours) => subHours(utcDate, hours),
		lastDays: (days) => subDays(utcDate, days),
		lastMonths: (months) => subMonths(utcDate, months),
		lastYears: (years) => subYears(utcDate, years),
		// Get a date with an offset that always includes the whole unit of the given interval
		includeHours: (hours) => subHours(startOfHour(utcDate), hours - 1),
		includeDays: (days) => subDays(startOfDay(utcDate), days - 1),
		includeMonths: (months) => subMonths(startOfMonth(utcDate), months - 1),
		includeYears: (years) => subYears(startOfYear(utcDate), years - 1)
	}

}
@@ -259,26 +259,30 @@
 nst 
-utcDate = Date.now
+currentDate = new Date
 ()%0A%0A
@@ -392,19 +392,23 @@
 seconds(
-utc
+current
 Date, mi
@@ -453,19 +453,23 @@
 ubHours(
-utc
+current
 Date, ho
@@ -504,19 +504,23 @@
 subDays(
-utc
+current
 Date, da
@@ -560,19 +560,23 @@
 bMonths(
-utc
+current
 Date, mo
@@ -615,19 +615,23 @@
 ubYears(
-utc
+current
 Date, ye
@@ -773,19 +773,23 @@
 tOfHour(
-utc
+current
 Date), h
@@ -843,19 +843,23 @@
 rtOfDay(
-utc
+current
 Date), d
@@ -920,19 +920,23 @@
 OfMonth(
-utc
+current
 Date), m
@@ -999,11 +999,15 @@
 ear(
-utc
+current
 Date

Rename var