Jump to content
View in the app

A better way to browse. Learn more.

Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ips.utils.time

Description

The time utility provides methods for working with timestamps.

 

Methods

string readable( number timestamp )

Returns the time as an approximate relative string, e.g. 8 hours ago, 2 days ago, Just now.

  • timestamp
    UNIX timestamp to use to generate the time string

 

boolean isDST()

Determines whether the user is currently in daylight savings (DST).

 

boolean isValidDateObj( mixed date )

Determines whether the provided date is a valid javascript Date object.

  • date
    The object to check

 

number timestamp()

Returns the current UNIX timestamp

 

string localeDateString( Date date, object options )

Returns a locale-aware string representing the provided date object. The options parameter can be used to adjust the formatting on browsers that support it. See MDN.

  • date
    A Date object used as the source
  • options
    Options object passed into javascript's toLocaleDateString function. See MDN for supported values.

 

boolean supportsHTMLDate()

Determines whether the HTML5 type='date' input is supported in the current browser.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.