{"id":23399921,"url":"https://github.com/zaadevofc/parse-times","last_synced_at":"2025-04-11T18:07:41.077Z","repository":{"id":63130348,"uuid":"565466475","full_name":"zaadevofc/parse-times","owner":"zaadevofc","description":"Simple parsing times and get complete times","archived":false,"fork":false,"pushed_at":"2022-11-14T07:53:40.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T19:05:35.902Z","etag":null,"topics":["date","get-time","moment","nodejs","parse","time"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/parse-times","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaadevofc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-13T14:01:45.000Z","updated_at":"2022-12-03T14:51:37.000Z","dependencies_parsed_at":"2023-01-21T19:00:13.838Z","dependency_job_id":null,"html_url":"https://github.com/zaadevofc/parse-times","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaadevofc%2Fparse-times","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaadevofc%2Fparse-times/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaadevofc%2Fparse-times/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaadevofc%2Fparse-times/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaadevofc","download_url":"https://codeload.github.com/zaadevofc/parse-times/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247654382,"owners_count":20973989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","get-time","moment","nodejs","parse","time"],"created_at":"2024-12-22T10:17:49.862Z","updated_at":"2025-04-11T18:07:41.055Z","avatar_url":"https://github.com/zaadevofc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Parse Times\n\nParsing waktu dan dapatkan result yang komplit!\n\nMenggunakan library dari [MomentJs](https://momentjs.com/).\n\nList of Function :\n\n* getTime() `// get =\u003e waktu saat ini =\u003e Objcet`\n* getWeton() `// get =\u003e weton berdasarkan waktu =\u003e String`\n* getTimeById() `// get =\u003e waktu berdasarkan id =\u003e Objcet`\n* getRelative() `// get =\u003e Realtive waktu  =\u003e String`\n* getCalendar() `// get =\u003e Calendar waktu  =\u003e String`\n\n## Installation\n\nInstall with npm:\n\n```js\n$ npm install parse-times\n```\n\nWith require:\n\n```js\nconst parseTimes = require(\"parse-times\");\n```\n\n### Usage\n\n#### Example :\n\nsee [example.js](https://github.com/zaadevofc/img-to-url/blob/master/example.js) for details.\n\n## Set Locale Time\n\nif you want to change the region, you must read the documentation [MomentJs](https://momentjs.com/).\n```js\nparseTimes.set('id') // Default =\u003e \"id\"\n````\n\n## Get default Time\n```js\nconst getTime = parseTimes.getTime() // Time Result =\u003e Object\nconst getTimeFormat = parseTimes.getTime({format: \"DD/MM/YYYY hh:mm:ss a\"}) // =\u003e 13/11/2022 19:50:18 malam\n\nconst timeId = new Date().getTime() || 1668343818991 // Get Time ID\nconst getTimeById = parseTimes.getTimeById(timeId) // Use Time ID \u0026\u0026 Time Result =\u003e Object\nconst getTimeByIdFormat = parseTimes.getTimeById(timeId, {format: \"DD/MM/YYYY hh:mm:ss a\"}) // =\u003e 13/11/2022 19:50:18 malam\n\n/* \nTime Result :\n{\n  millisecond: 991,\n  second: 18,\n  minute: 50,\n  hour: 19,\n  date: 13,\n  day: 0,\n  dayed: 'Min',\n  days: 'Minggu',\n  month: 11,\n  monthy: 'Nov',\n  months: 'November',\n  year: 22,\n  years: 2022,\n  situasion: 'malam',\n  full: {\n    ll: '13 Nov 2022',\n    LL: '13 November 2022',\n    lll: '13 Nov 2022 pukul 19.50',\n    LLL: '13 November 2022 pukul 19.50',\n    llll: 'Min, 13 Nov 2022 pukul 19.50',\n    LLLL: 'Minggu, 13 November 2022 pukul 19.50'\n  },\n  region: { code: 'id', name: 'Indonesia', flag: '🇮🇩' },\n  timeId: 1668343818991\n}\n*/\n```\n\n## Get Weton\n```js\nconst getWeton = parseTimes.getWeton(17, 11, 2022) // Date, Month, Year (required)\n// =\u003e Pahing\n```\n\n## Get Relative Time\n```js\nconst timeId = new Date().getTime() || 1668343818991 // Get Time ID\n\nconst getRelativeById = parseTimes.getRelative(timeId) // =\u003e 14 menit yang lalu\nconst getRelativeBySeconds = parseTimes.getRelative(timeId, {input: 10, based: 'seconds'}) // =\u003e dalam beberapa detik\nconst getRelativeMinutes = parseTimes.getRelative(timeId, {input: 10, based: 'minutes'}) // =\u003e dalam 10 menit\nconst getRelativeHours = parseTimes.getRelative(timeId, {input: 10, based: 'hours'}) // =\u003e dalam 10 jam\nconst getRelativeDays = parseTimes.getRelative(timeId, {input: 10, based: 'days'}) // =\u003e dalam 10 hari\nconst getRelativeMonths = parseTimes.getRelative(timeId, {input: 10, based: 'months'}) // =\u003e dalam 10 bulan\nconst getRelativeYears = parseTimes.getRelative(timeId, {input: 10, based: 'years'}) // =\u003e dalam 10 tahun\n```\n\n## Get Calendar Time\n```js\nconst timeId = new Date().getTime() || 1668343818991 // Get Time ID\n\nconst getCalendarById = parseTimes.getCalendar(timeId) // =\u003e Hari ini pukul 19.50\nconst getCalendarBySeconds = parseTimes.getCalendar(timeId, {input: 10, based: 'seconds'}) // =\u003e Hari ini pukul 20.09\nconst getCalendarMinutes = parseTimes.getCalendar(timeId, {input: 10, based: 'minutes'}) // =\u003e Hari ini pukul 20.19\nconst getCalendarHours = parseTimes.getCalendar(timeId, {input: 10, based: 'hours'}) // =\u003e Besok pukul 06.09\nconst getCalendarDays = parseTimes.getCalendar(timeId, {input: 10, based: 'days'}) // =\u003e 23/11/2022\nconst getCalendarMonths = parseTimes.getCalendar(timeId, {input: 10, based: 'months'}) // =\u003e 13/09/2023\nconst getCalendarYears = parseTimes.getCalendar(timeId, {input: 10, based: 'years'}) // =\u003e 13/11/2032\n```\n\n## Testing\n\nInstall dependencies:\n\n```\nnpm install\n```\n\nRun tests:\n\n```\nnpm run test\n```\n\n## License\n\nCode released under the [Apache license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaadevofc%2Fparse-times","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaadevofc%2Fparse-times","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaadevofc%2Fparse-times/lists"}