@mangar2/time

1.1.3 • Public • Published

Abstract

Contents

Meta

Global functions

dateToTimeOfDayInSeconds

dateToTimeOfDayInSeconds (date) => {number}

Gets the seconds since midnight of a date .

dateToTimeOfDayInSeconds Parameters

Name Type Description
date Date date to concider

dateToTimeOfDayInSeconds returns

Type Description
number amount of seconds passed since midnight

isTimeOfDayString

isTimeOfDayString (timeString) => {boolean}

Checks , if a string is a time of day string ( HH : MM or HH : MM : SS )

isTimeOfDayString Parameters

Name Type Description
timeString string delta time

isTimeOfDayString returns

Type Description
boolean true , if the string is a time of day string

stringToSeconds

stringToSeconds (timeString) => {number}

Converts a time string in format HH : MM or HH : MM : SS or MMM to seconds

stringToSeconds Parameters

Name Type Description
timeString string delta time

stringToSeconds throws

Type Description
Error on false date format

stringToSeconds returns

Type Description
number time string in seconds

timeOfDayStringToDate

timeOfDayStringToDate (timeString) => {Date}

Converts a time string in format HH : MM or HH : MM : SS or MMM to a date ( today , same time of day )

timeOfDayStringToDate Parameters

Name Type Description
timeString string time of day

timeOfDayStringToDate throws

Type Description
Error on false time format

timeOfDayStringToDate returns

Type Description
Date today , hours , minutes , seconds set to the time of day string

/@mangar2/time/

    Package Sidebar

    Install

    npm i @mangar2/time

    Weekly Downloads

    6

    Version

    1.1.3

    License

    LGPL-3.0-or-later

    Unpacked Size

    7.88 kB

    Total Files

    5

    Last publish

    Collaborators

    • mangar2