Skip to content

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.

License

Notifications You must be signed in to change notification settings

automediaAI/get-rounded-time

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Get Current Time Github Action

This action sets the current ISO8601 time to the time output. Useful for setting build times in subsequent steps, rename your artifact, or keeping the same recorded time for the entire workflow.

Inputs

format

Time format to use - using MomemtJS format syntax - optional

utcOffset

UTC time offset to use - using MomemtJS utcOffset syntax - optional

Outputs

time

The UTC time when this step was run.

formattedTime

The UTC time when this step was run - formatted using format input.

Example usage

steps:
  - name: Get current time
    uses: 1466587594/get-current-time@v1
    id: current-time
    with:
      format: YYYYMMDD-HH
      utcOffset: "+08:00"
  - name: Use current time
    env:
      TIME: "${{ steps.current-time.outputs.time }}"
      F_TIME: "${{ steps.current-time.outputs.formattedTime }}"
    run: echo $TIME $F_TIME

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%