
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
fancy-timestamp
Advanced tools
#Fancy Timestamp
Use this to create natural language for your unix timestamps (similar to Facebook's)
Plays well with browserify
#Usage Install with NPM and require where needed.
npm install fancy-timestamp
var fancyTimestamp = require('fancy-timestamp');
Fancy Timestamp can accept normal timestamps composed of seconds.
var normalTimestamp = 1342123755; //Using only seconds
var fancyTimestampString = fancyTimestamp(normalTimestamp); // result == "8 minutes ago"
It can also accept timestamps composed of milliseconds such as the ones JavaScript defaults to. To parse millisecond timestamps pass a second parameter of 'true'.
var javascriptTimestamp = (new Date()).getTime(); //Using JavaScript's timestamp composed of milliseconds
fancyTimestampString = fancyTimestamp(javascriptTimestamp, true); // result == "Just now"
Where appropriate, fancy-timestamp will apply the appropriate ending to the natural language text such as 'tomorrow' or 'away' for dates in the future, and 'yesterday' or 'ago' for dates in the past.
#License MIT license
FAQs
Create natural language from UNIX timestamps
We found that fancy-timestamp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.