bradymholt / cRonstrue

JavaScript library that translates Cron expressions into human readable descriptions
http://bradymholt.github.io/cRonstrue/
MIT License
1.28k stars 168 forks source link

tzOffset is not uniform, only applies to first part of the cron toString expression, rest of the expression is still set at UTC timezone #289

Closed SergioJFalcon closed 1 year ago

SergioJFalcon commented 1 year ago

Cron Expression 10 11 * * * with a tzOffset of -4 and verbose is set to true

Expected Output "At 07:10 AM, every day At 07:00"

Actual Output "At 07:10 AM, every day At 11:10"

Prerequisites

bradymholt commented 1 year ago

@SergioJFalcon - The Expected and Actual Output in your example looks unexpected and possible modified before output by some code other than what cRonstrue is providing. Something like "At 07:10 AM, every day At 07:00" seems incorrect and not something cRonstrue would emit.

I tested your expression with tzOffset = -4 and it seems to be working correctly: https://runkit.com/bradymholt/64d4cf24b957c800080269df

Also, a test has been added here: https://github.com/bradymholt/cRonstrue/pull/290