Skip to content

Releases: josStorer/get-current-time

Get current time v2.1.2

16 Feb 08:10
Compare
Choose a tag to compare

What's Changed

  • bump deps
  • update to node20
  • update action description

New Contributors

Full Changelog: v2.1.1...v2.1.2


Get Current Time Github Action

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.

You can view some typical input/output in the action.test.js file.

Inputs

format

Time format to use - using MomentJS format syntax - optional

utcOffset

UTC offset to use - using MomentJS utcOffset syntax - optional

timezone

Timezone to use - check moment-timezone list -
optional, if set, utcOffset will be ignored, e.g. "America/Los_Angeles"

Outputs

time

The ISO time this action was run, not affected by the parameter utcOffset e.g. '2020-01-01T00:30:15.000Z'

ISOTime

Same as time

readableTime

Human-friendly time - affected by the parameter utcOffset e.g. 'Wed Jan 01 2020 08:30:15 GMT+0800'

formattedTime

The time this action was run - formatted using format and utcOffset inputs

year,month,day,hour,minute,second,millisecond

Digital outputs, just as names

Example usage

steps:
  - name: Get current time
    uses: josStorer/get-current-time@v2
    id: current-time
    with:
      format: YYYYMMDD-HH
      utcOffset: "+08:00"
  - name: Use current time
    env:
      TIME: "${{ steps.current-time.outputs.time }}"
      R_TIME: "${{ steps.current-time.outputs.readableTime }}"
      F_TIME: "${{ steps.current-time.outputs.formattedTime }}"
      YEAR: "${{ steps.current-time.outputs.year }}"
      DAY: "${{ steps.current-time.outputs.day }}"
    run: echo $TIME $R_TIME $F_TIME $YEAR $DAY

Get current time v2.1.1

12 Mar 04:54
Compare
Choose a tag to compare

What's Changed

  • Adds timezone input to action.yml by @ImportTaste in #21

New Contributors

  • @ImportTaste made their first contribution in #21

Get current time v2.1.0

04 Mar 07:38
Compare
Choose a tag to compare

Features

  • add timezone input field (#19)

Bug Fixes

  • when no utcOffset is passed, force it to be set to UTC+0

Tests

  • rewrite test code

Documents

New Contributors

Get current time v2.0.2

12 Oct 14:41
3406642
Compare
Choose a tag to compare

Update packages by commit-bab18627 to fix a warning (#6)

Get current time v2.0.1

08 Aug 13:30
Compare
Choose a tag to compare

Get current time v2.0.0

19 Aug 03:34
Compare
Choose a tag to compare

Get Current Time Github Action

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.

Inputs

format

Time format to use - using MomemtJS format syntax - optional

utcOffset

UTC offset to use - using MomemtJS utcOffset syntax - optional

Outputs

time

The ISO time this action was run, not affected by the parameter utcOffset e.g. '2020-01-01T00:30:15.000Z'

ISOTime

Same as time

readableTime

Human-friendly time - affected by the parameter utcOffset e.g. 'Wed Jan 01 2020 08:30:15 GMT+0800'

formattedTime

The time this action was run - formatted using format and utcOffset inputs

year,month,day,hour,minute,second,millisecond

Digital outputs, just as names

Example usage

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

Get current time v1.0.0

02 Mar 10:56
Compare
Choose a tag to compare

Get Current Time Github Action

This action sets the current ISO8601 time to the time output. Useful for setting build times in subsequent steps, renaming 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