All Projects โ†’ xxczaki โ†’ timestampy

xxczaki / timestampy

Licence: MIT license
๐Ÿ•’ Bunch of utilities useful when working with UNIX timestamps

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to timestampy

Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: โœญ 750 (+3471.43%)
Mutual labels:  utility, utilities, utils
bat
Battery management utility for Linux laptops.
Stars: โœญ 107 (+409.52%)
Mutual labels:  utility, utilities, utils
Timestamp
โฐ A better macOS menu bar clock.
Stars: โœญ 296 (+1309.52%)
Mutual labels:  time, clock, timestamp
Schematics Utilities
๐Ÿ› ๏ธ Useful exported utilities for working with Schematics
Stars: โœญ 73 (+247.62%)
Mutual labels:  utility, utilities, utils
timelite
String date and time utilities ๐Ÿ•™
Stars: โœญ 17 (-19.05%)
Mutual labels:  time, utilities
ardusamber
Desamber time Arduino corporealization
Stars: โœญ 20 (-4.76%)
Mutual labels:  time, clock
clocklet
An opinionated clock-style vanilla-js timepicker.
Stars: โœญ 31 (+47.62%)
Mutual labels:  time, clock
table2ascii
Python library for converting lists to fancy ASCII tables for displaying in the terminal and on Discord
Stars: โœญ 31 (+47.62%)
Mutual labels:  utilities, utils
dynamic-utils
Utility functions to perform dynamic operations on Android.
Stars: โœญ 86 (+309.52%)
Mutual labels:  package, utilities
TimeContinuum
No description or website provided.
Stars: โœญ 28 (+33.33%)
Mutual labels:  time, clock
OrganizeMediaFiles
a collection of Python scripts that help you organize media files into a directory tree "year/month" based on metadata , using exiftool
Stars: โœญ 24 (+14.29%)
Mutual labels:  utilities, utils
Packagehunter
๐Ÿ“ฅ [Android Library] Hunt down all package information
Stars: โœญ 137 (+552.38%)
Mutual labels:  package, utility
Cs.2click
๐Ÿ”Š A Better Audio Router for a Modular System.
Stars: โœญ 7 (-66.67%)
Mutual labels:  package, utility
time
The simplest but configurable online clock
Stars: โœญ 77 (+266.67%)
Mutual labels:  time, clock
portuguese-utils
A set of useful utils for developing portuguese apps
Stars: โœญ 20 (-4.76%)
Mutual labels:  package, utils
telltime
iOS application to tell the time in the British way ๐Ÿ‡ฌ๐Ÿ‡งโฐ
Stars: โœญ 49 (+133.33%)
Mutual labels:  time, clock
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: โœญ 15 (-28.57%)
Mutual labels:  utility, time
FM-JSON-Types
FileMaker Data Types in JSON
Stars: โœญ 14 (-33.33%)
Mutual labels:  time, timestamp
ElevenClock
ElevenClock: Customize Windows 11 taskbar clock
Stars: โœญ 1,494 (+7014.29%)
Mutual labels:  time, clock
ngx http hmac secure link module
HMAC Secure Link module for NGINX.
Stars: โœญ 47 (+123.81%)
Mutual labels:  unix-timestamp, timestamp

Timestampy

Bunch of utilities useful when working with UNIX timestamps ๐Ÿ•’

Build Status XO Code Style


Highlights

  • Simple API
  • No dependencies
  • Tree Shakeable
  • Written in TypeScript

Install

npm install timestampy

Usage

import {addHours, toDate} from 'timestampy'

addHours(1546344000, {amount: 3}); //=> 1546354800
toDate(1564146357); //=> '7/26/2019'

API

  • Add
    • addSeconds
    • addMinutes
    • addHours
    • addDays
    • addWeeks
    • addMonths
    • addYears
  • Subtract
    • subtractSeconds
    • subtractMinutes
    • subtractHours
    • subtractDays
    • subtractWeeks
    • subtractMonths
    • subtractYears
  • Is
    • isOlderThan
    • isNewerThan
    • isMinuteOld
    • isHourOld
    • isDayOld
    • isWeekOld
    • isFortnightOld
    • isMonthOld
    • isHalfYearOld
    • isYearOld
    • isOldCustom
  • To
    • toDate
    • toTime
  • Other
    • getCurrentTimestamp
    • howOld

Add

addSeconds(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of seconds you want to add to the timestamp.


addMinutes(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of minutes you want to add to the timestamp.


addHours(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of hours you want to add to the timestamp.


addDays(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of days you want to add to the timestamp.


addWeeks(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of weeks you want to add to the timestamp.


addMonths(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of months you want to add to the timestamp.


addYears(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of years you want to add to the timestamp.


Subtract

subtractSeconds(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of seconds you want to subtract from the timestamp.


subtractMinutes(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of minutes you want to subtract from the timestamp.


subtractHours(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of hours you want to subtract from the timestamp.


subtractDays(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of days you want to subtract from the timestamp.


subtractWeeks(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of weeks you want to subtract from the timestamp.


subtractMonths(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of months you want to subtract from the timestamp.


subtractYears(timestamp, {options})

Returns a modified timestamp.

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

amount

Type: number

The amount of years you want to subtract from the timestamp.


Is

isOlderThan(firstTimestamp, secondTimestamp)

Returns a boolean of whether the firstTimestamp is older than the secondTimestamp.

firstTimestamp

Type: number

UNIX Timestamp.

secondTimestamp

Type: number

UNIX Timestamp.


isNewerThan(firstTimestamp, secondTimestamp)

Returns a boolean of whether the firstTimestamp is newer than the secondTimestamp.

firstTimestamp

Type: number

UNIX Timestamp.

secondTimestamp

Type: number

UNIX Timestamp.

isMinuteOld(timestamp)

Returns a boolean of whether the timestamp is at least minute old (from now).

timestamp

Type: number

UNIX Timestamp.


isHourOld(timestamp)

Returns a boolean of whether the timestamp is at least an hour old (from now).

timestamp

Type: number

UNIX Timestamp.


isDayOld(timestamp)

Returns a boolean of whether the timestamp is at least a day old (from now).

timestamp

Type: number

UNIX Timestamp.


isWeekOld(timestamp)

Returns a boolean of whether the timestamp is at least week old (from now).

timestamp

Type: number

UNIX Timestamp.


isFortnightOld(timestamp)

Returns a boolean of whether the timestamp is at least 2 weeks (from now).

timestamp

Type: number

UNIX Timestamp.


isMonthOld(timestamp)

Returns a boolean of whether the timestamp is at least month old (from now).

timestamp

Type: number

UNIX Timestamp.


isHalfYearOld(timestamp)

Returns a boolean of whether the timestamp is at 6 months old (from now).

timestamp

Type: number

UNIX Timestamp.


isYearOld(timestamp)

Returns a boolean of whether the timestamp is at least year old (from now).

timestamp

Type: number

UNIX Timestamp.


isOldCustom(timestamp, {options})

Returns a boolean of whether the timestamp is at least year old (from now).

timestamp

Type: number

UNIX Timestamp.

options

Type: object

Any of the options below.

time

Type: number

How old the timestamp should be for the function to return true.


To

toDate(timestamp)

Returns a date extracted from timestamp.

timestamp

Type: number

UNIX Timestamp.


toTime(timestamp)

Returns time extracted from timestamp.

timestamp

Type: number

UNIX Timestamp.


Other

getCurrentTimestamp()

Returns a current UNIX timestamp.


howOld(timestamp)

Returns the amount of second of how old the given timestamp is (from now).

timestamp

Type: number

UNIX Timestamp.


License

MIT ยฉ Antoni Kepinski

Timestamp icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].