
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Dapatkan waktu lengkap dalam bentuk json maupun string.
Menggunakan library dari MomentJs.
List of Function :
// Mendapatkan waktu saat ini => Objcet
// Mendapatkan weton berdasarkan waktu => String
// Mendapatkan waktu berdasarkan id => Objcet
// Mendapatkan Realtive waktu => String
// Mendapatkan Calendar waktu => String
Install with npm:
$ npm install timesJs
With require:
const timeJs = require("timeJs");
see example.js for details.
const getTime = moment.getTime() // Time Result => Object
const getTimeFormat = moment.getTime({format: "DD/MM/YYYY hh:mm:ss a"}) // => 13/11/2022 19:50:18 malam
const timeId = new Date().getTime() || 1668343818991 // Get Time ID
const getTimeById = moment.getTimeById(timeId) // Use Time ID && Time Result => Object
const getTimeByIdFormat = moment.getTimeById(timeId, {format: "DD/MM/YYYY hh:mm:ss a"}) // => 13/11/2022 19:50:18 malam
/*
Time Result :
{
millisecond: 991,
second: 18,
minute: 50,
hour: 19,
date: 13,
day: 0,
dayed: 'Min',
days: 'Minggu',
month: 11,
monthy: 'Nov',
months: 'November',
year: 22,
years: 2022,
situasion: 'malam',
full: {
ll: '13 Nov 2022',
LL: '13 November 2022',
lll: '13 Nov 2022 pukul 19.50',
LLL: '13 November 2022 pukul 19.50',
llll: 'Min, 13 Nov 2022 pukul 19.50',
LLLL: 'Minggu, 13 November 2022 pukul 19.50'
},
region: { code: 'id', name: 'Indonesia', flag: '🇮🇩' },
timeId: 1668343818991
}
*/
const getWeton = moment.getWeton(17, 11, 2022) // Date, Month, Year (required)
// => Pahing
const timeId = new Date().getTime() || 1668343818991 // Get Time ID
const getRelativeById = moment.getRelative(timeId) // => 14 menit yang lalu
const getRelativeBySeconds = moment.getRelative(timeId, {input: 10, based: 'seconds'}) // => dalam beberapa detik
const getRelativeMinutes = moment.getRelative(timeId, {input: 10, based: 'minutes'}) // => dalam 10 menit
const getRelativeHours = moment.getRelative(timeId, {input: 10, based: 'hours'}) // => dalam 10 jam
const getRelativeDays = moment.getRelative(timeId, {input: 10, based: 'days'}) // => dalam 10 hari
const getRelativeMonths = moment.getRelative(timeId, {input: 10, based: 'months'}) // => dalam 10 bulan
const getRelativeYears = moment.getRelative(timeId, {input: 10, based: 'years'}) // => dalam 10 tahun
const timeId = new Date().getTime() || 1668343818991 // Get Time ID
const getCalendarById = moment.getCalendar(timeId) // => Hari ini pukul 19.50
const getCalendarBySeconds = moment.getCalendar(timeId, {input: 10, based: 'seconds'}) // => Hari ini pukul 20.09
const getCalendarMinutes = moment.getCalendar(timeId, {input: 10, based: 'minutes'}) // => Hari ini pukul 20.19
const getCalendarHours = moment.getCalendar(timeId, {input: 10, based: 'hours'}) // => Besok pukul 06.09
const getCalendarDays = moment.getCalendar(timeId, {input: 10, based: 'days'}) // => 23/11/2022
const getCalendarMonths = moment.getCalendar(timeId, {input: 10, based: 'months'}) // => 13/09/2023
const getCalendarYears = moment.getCalendar(timeId, {input: 10, based: 'years'}) // => 13/11/2032
Install dependencies:
npm install
Run tests:
npm run test
Code released under the Apache license.
FAQs
Get Time and simple result
The npm package curr-time receives a total of 0 weekly downloads. As such, curr-time popularity was classified as not popular.
We found that curr-time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.