{"id":20439551,"url":"https://github.com/josstorer/get-current-time","last_synced_at":"2025-10-08T15:14:26.170Z","repository":{"id":65155188,"uuid":"244312740","full_name":"josStorer/get-current-time","owner":"josStorer","description":"This action sets the current ISO8601 time to the time output and also provides readableTime, formattedTime, and many more digital outputs like year, day, second, etc. Useful for setting build times in subsequent steps, renaming your artifact, or keeping the same recorded time for the entire workflow.","archived":false,"fork":false,"pushed_at":"2024-02-19T18:51:44.000Z","size":2267,"stargazers_count":39,"open_issues_count":3,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T22:42:30.692Z","etag":null,"topics":["actions","github-actions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josStorer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-02T08:00:08.000Z","updated_at":"2024-12-15T20:30:39.000Z","dependencies_parsed_at":"2024-08-13T14:40:22.992Z","dependency_job_id":null,"html_url":"https://github.com/josStorer/get-current-time","commit_stats":{"total_commits":49,"total_committers":9,"mean_commits":5.444444444444445,"dds":0.5714285714285714,"last_synced_commit":"5979d2f4455ed5df566aa6df67cedd77d17afaa9"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josStorer%2Fget-current-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josStorer%2Fget-current-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josStorer%2Fget-current-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josStorer%2Fget-current-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josStorer","download_url":"https://codeload.github.com/josStorer/get-current-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643046,"owners_count":21138353,"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":["actions","github-actions"],"created_at":"2024-11-15T09:18:03.506Z","updated_at":"2025-10-08T15:14:21.114Z","avatar_url":"https://github.com/josStorer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test the action workflow](https://github.com/josStorer/get-current-time/workflows/Test%20the%20action/badge.svg)](https://github.com/josStorer/get-current-time/actions?query=workflow:\"Test+the+action\")\n[![Codecov](https://codecov.io/gh/josStorer/get-current-time/graph/badge.svg)](https://codecov.io/gh/josStorer/get-current-time)\n[![GitHub release](https://img.shields.io/github/release/josStorer/get-current-time.svg)](https://github.com/josStorer/get-current-time/releases/latest)\n[![GitHub marketplace](https://img.shields.io/badge/marketplace-get--current--time-blue?logo=github)](https://github.com/marketplace/actions/get-current-time)\n[![Repo contributors](https://img.shields.io/github/contributors/josStorer/get-current-time.svg)](https://github.com/josStorer/get-current-time/graphs/contributors)\n[![Open issues](https://img.shields.io/github/issues-raw/josStorer/get-current-time)](https://github.com/josStorer/get-current-time/issues?q=is%3Aissue+is%3Aopen)\n[![Solved issues](https://img.shields.io/github/issues-closed-raw/josStorer/get-current-time/solved?color=4bc51d\u0026label=solved%20issues)](https://github.com/josStorer/get-current-time/issues?q=is%3Aissue+label%3Asolved)\n\n# Get Current Time Github Action\n\nThis action sets the current ISO8601 time to the `time` output and also provides `readableTime`, `formattedTime`, and\nmany more digital outputs like `year`, `day`, `second`, etc. Useful for setting build times in subsequent steps,\nrenaming your artifact, or keeping the same recorded time for the entire workflow.\n\nYou can view some typical input/output in the [action.test.js](./action.test.js) file.\n\n## Inputs\n\n### `format`\n\nTime format to use - using [MomentJS format syntax](https://momentjs.com/docs/#/displaying/format/) - optional\n\n### `utcOffset`\n\nUTC offset to use - using [MomentJS utcOffset syntax](https://momentjs.com/docs/#/manipulating/utc-offset/) - optional\n\n### `timezone`\n\nTimezone to use - check [moment-timezone list](https://gist.github.com/diogocapela/12c6617fc87607d11fd62d2a4f42b02a) -\noptional, if set, utcOffset will be ignored, e.g. \"America/Los_Angeles\"\n\n## Outputs\n\n### `time`\n\nThe ISO time this action was run, **not** affected by the parameter `utcOffset`  e.g. '2020-01-01T00:30:15.000Z'\n\n### `ISOTime`\n\nSame as `time`\n\n### `readableTime`\n\nHuman-friendly time - affected by the parameter `utcOffset`  e.g. 'Wed Jan 01 2020 08:30:15 GMT+0800'\n\n### `formattedTime`\n\nThe time this action was run - formatted using `format` and `utcOffset` inputs\n\n### `year,month,day,hour,minute,second,millisecond`\n\nDigital outputs, just as names\n\n## Example usage\n\n```yaml\nsteps:\n  - name: Get current time\n    uses: josStorer/get-current-time@v2\n    id: current-time\n    with:\n      format: YYYYMMDD-HH\n      utcOffset: \"+08:00\"\n  - name: Use current time\n    env:\n      TIME: \"${{ steps.current-time.outputs.time }}\"\n      R_TIME: \"${{ steps.current-time.outputs.readableTime }}\"\n      F_TIME: \"${{ steps.current-time.outputs.formattedTime }}\"\n      YEAR: \"${{ steps.current-time.outputs.year }}\"\n      DAY: \"${{ steps.current-time.outputs.day }}\"\n    run: echo $TIME $R_TIME $F_TIME $YEAR $DAY\n```\n\n## Run locally\n\n### First\n\n```\nnpm install\n```\n\n### Build\n\n```\nnpm start\n```\n\nAnd you'll see the index.js is generated in the dist folder\n\n### Test\n\n```\nnpm test\n```\n\nAnd you'll see the console output as following:\n\n***\n\n**PASS**  ./action.test.js\n\n\u0026ensp;\u0026ensp;action\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;**√** Should load (1 ms)\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;**√** Should correctly set outputs (1 ms)\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;**√** Should correctly set outputs with utcOffset (1 ms)\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;**√** Should correctly set outputs with timezone (1 ms)\n\n\u0026ensp;\u0026ensp;\u0026ensp;\u0026ensp;**√** Should throw error (1 ms)\n\n| File            | %\u0026nbsp;Stmts | %\u0026nbsp;Branch | %\u0026nbsp;Funcs | %\u0026nbsp;Lines | Uncovered\u0026nbsp;Line\u0026nbsp;#s |\n|-----------------|--------------|---------------|--------------|--------------|-----------------------------|\n| All files       | 100          | 100           | 100          | 100          |                             |\n| \u0026nbsp;action.js | 100          | 100           | 100          | 100          |                             |\n\nTest Suites: **1 passed**, 1 total\n\nTests:       **5 passed**, 5 total\n\nSnapshots:   0 total\n\nTime:        1 s\n\nRan all test suites.\n\n***\n\n## Credit\n\nThis project is forked from [srfrnk/current-time](https://github.com/srfrnk/current-time) and detached since 14 December\nof 2022\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosstorer%2Fget-current-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosstorer%2Fget-current-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosstorer%2Fget-current-time/lists"}