Home Reference Source Repository

Function

Static Public Summary
public

captures a stacktrace at the current code execution point

public

days(n: Integer): Integer

returns n number of days converted to milliseconds.

public

hours(n: Integer): Integer

returns n number of hours converted to milliseconds

public

humanize(start: Integer): Object

returns a humanized time representation of the difference between two millisecond dates

public

kill(): *

Drains the thinky database pool

public

minutes(n: Integer): Integer

returns n number of minutes converted to milliseconds

public

olderThan(date: Date, milliDate: Integer): Boolean

compares a Date Object to a millisecond representation

public

seconds(n: Integer): Integer

returns n number of seconds converted to milliseconds

public

secondsAgo(n: Integer): Integer

returns how many seconds have elapsed since n compared to Date.now()

Static Public

public captureStack(): * source

import {captureStack} from 'wyst/es6/Errors/index.js'

captures a stacktrace at the current code execution point

Return:

*

public days(n: Integer): Integer source

import {days} from 'wyst/es6/utils/Time.js'

returns n number of days converted to milliseconds.

Params:

NameTypeAttributeDescription
n Integer

the number of days

Return:

Integer

Example:


days(1) // 1000 * 60 * 60 * 24

public hours(n: Integer): Integer source

import {hours} from 'wyst/es6/utils/Time.js'

returns n number of hours converted to milliseconds

Params:

NameTypeAttributeDescription
n Integer

the number of hours

Return:

Integer

Example:


hours(1) // 1000 * 60 * 60

public humanize(start: Integer): Object source

import {humanize} from 'wyst/es6/utils/Time.js'

returns a humanized time representation of the difference between two millisecond dates

Params:

NameTypeAttributeDescription
start Integer

the start date in number of milliseconds since 1 January, 1970 UTC

Date.now() Integer
  • optional

end the end date in number of milliseconds

Return:

Object

public kill(): * source

import {kill} from 'wyst/es6/thinky.js'

Drains the thinky database pool

Return:

*

public minutes(n: Integer): Integer source

import {minutes} from 'wyst/es6/utils/Time.js'

returns n number of minutes converted to milliseconds

Params:

NameTypeAttributeDescription
n Integer

the number of minutes

Return:

Integer

Example:


minutes(1) // 1000 * 60

public olderThan(date: Date, milliDate: Integer): Boolean source

import {olderThan} from 'wyst/es6/utils/Time.js'

compares a Date Object to a millisecond representation

Params:

NameTypeAttributeDescription
date Date

a Date object

milliDate Integer

a millisecond representation of a Date

Return:

Boolean

whether date is older than milliDate

public seconds(n: Integer): Integer source

import {seconds} from 'wyst/es6/utils/Time.js'

returns n number of seconds converted to milliseconds

Params:

NameTypeAttributeDescription
n Integer

the number of seconds

Return:

Integer

Example:


seconds(2) // 2000 

public secondsAgo(n: Integer): Integer source

import {secondsAgo} from 'wyst/es6/utils/Time.js'

returns how many seconds have elapsed since n compared to Date.now()

Params:

NameTypeAttributeDescription
n Integer

the start date in milliseconds

Return:

Integer

the number of seconds that have elapsed