A simple package that outputs the time of a node.js server in specific format
This started as a test using Javascript dateTime module.
Has been setup in standalone package for my other projects to use.
Format is HH:MM:SS DD(st/nd/rd/th) of MM YYYY
Uses the Javascript dateTime
module
- Run
npm install dMacGit/ServerTime
to manually add the package. OR Simply add this package to your dependancies lisk in package.json file then Runnpm install
ornpm clean-install
//Config to add into your package.json file
"dependencies": {
"myServerTime": "github:dMacGit/ServerTime"
}
- Import it as a package in your app.js file or equivalent main.js file
const constName = require('myServerTime')
This can be used in either of two ways:
-
Calling
generateTime()
which generates a dateTime object, then passes it to theformatTime()
function to return it in a readable format. -
Calling
formatTime()
directly and passing it in adateTime
object.
This project is complete, and not under further develeopment.