Methods
-
deltaDays( delta ) → {DateTime}
-
Description
Add or Subtract the specified number of days to the DateTime's date
Parameters
Name Type Description delta
+/- number of days to add
Returns
Details
-
deltaMins( delta ) → {DateTime}
-
Description
Add or Subtract the specified number of minutes to the DateTime's time
Parameters
Name Type Description delta
+/- number of minutes to add
Returns
Details
-
getTimeSeconds() → {int}
-
Description
Get the time in seconds since midnight
Returns
Details
-
getTimeInt() → {string}
-
Description
Get the Time in HHmm format
Returns
Details
-
getTimeGTFS() → {string}
-
Description
Get the GTFS Spec time representation (HH:mm:ss)
Returns
Details
-
getTimeReadable() → {string}
-
Description
Get the human readable time (12 hr with AM/PM)
Returns
Details
-
isDateSet() → {boolean}
-
Description
Check if the date is set
Returns
Details
-
getDateInt() → {int}
-
Description
Get the integer representation of the date (yyyymmdd)
Returns
Details
-
getDateDOW() → {string}
-
Description
Get the full name of the weekday of the date (monday, tuesday, etc)
Returns
Details
-
getDateReadable( dow ) → {string}
-
Description
Get the human readable date ([Thu, ]Apr 18, 2019)
Parameters
Name Type Description dow
boolean When true, include the day of the week
Returns
Details
-
toMySQLString() → {string}
-
Description
Get a String representation of the DateTime to be used as a MySQL DateTime
Returns
Details
-
toHTTPString() → {string}
-
Description
Get a String representation of the DateTime to be used in HTTP Headers
Returns
Details
-
toTimestamp() → {number}
-
Description
Get a timestamp (in ms) of the DateTime
Returns
Details
-
toString() → {string}
-
Description
Get a String representation of the DateTIme
Returns
Details
-
clone() → {DateTime}
-
Description
Create a new DateTime Object with the properties of this one
Returns
Details
-
<static> create( time, date ) → {DateTime}
-
Description
DateTime Factory: with time and date
Parameters
Name Type Description time
string | int Time
date
int Date
Returns
Details
-
<static> now() → {DateTime}
-
Description
DateTime Factory: date and time of now
Returns
Details
-
<static> createFromJSDate( jd )
-
Description
DateTime Factory: with JavaScript Date
Parameters
Name Type Description jd
Date JavaScript Date
Details
-
<static> createFromTime( time [, guessDate ] ) → {DateTime}
-
Description
DateTime Factory: with time
Parameters
Name Type Attributes Default Description time
string Time
guessDate
boolean <optional> false Set to true to guess the Date relative to today
Returns
Details
-
<static> createFromDate( date ) → {DateTime}
-
Description
DateTime Factory: with date
Parameters
Name Type Description date
int Date
Returns
Details