## [0.9.5] - 2026-03-12 - Time & Timezone Fixes#161
Merged
alaa-eddine merged 6 commits intomainfrom Mar 12, 2026
Merged
Conversation
Let TimeHelper instance could be treated as Series. This fixed #156
Fix 2: time_tradingday Fix 3: setTimezone display-only
Prs integration + time functions updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
PineTS.setTimezone(timezone): Display-only chart timezone (like TradingView's timezone picker). Accepts IANA names,UTC±Noffsets, or'UTC'. Only affectslog.*timestamp formatting — computation functions (timestamp(),hour,dayofmonth,time_tradingday, etc.) always use the exchange timezone fromsyminfo.timezone.Fixed
closeTimeNormalization:BinanceProviderandMockProvidernow normalizecloseTimeto the TradingView convention (closeTime = nextBar.openTime) instead of Binance's rawnextBarOpen - 1ms.IProviderdocs updated to specify this convention. For array-based data missingcloseTime,PineTSnow estimates it asopenTime + timeframe duration(falls back to 1D when unknown).time_tradingdayUses Close Date: Was returning midnight UTC of the bar's open date. Now correctly returns midnight UTC of the close date (matching TradingView). E.g. a weekly bar opening2019-01-07→ closes2019-01-14→time_tradingday = 2019-01-14 00:00 UTC.timestamp(dateString)Exchange Timezone: Date strings like"2019-06-10 00:00"were parsed in the host system's local timezone. Now explicitly resolved in the exchange timezone (syminfo.timezone), matching TradingView behaviour. Strings with explicit offsets orZare honoured as-is.TimeHelperasSeries(#156):Series.from()now unwraps NAMESPACES_LIKE dual-use objects (time,time_close, etc.) by detecting the.__valueSeries property, instead of wrapping the object itself. Added a null-guard to prevent a crash when the source isnull. (contribution by @dcaoyuan)LogTimestamps Use Chart Timezone:log.info/warning/errorhardcoded UTC for bar timestamp prefixes. They now respect the timezone set viasetTimezone(), falling back to the exchange timezone.Etc/UTCAlias: Added'Etc/UTC'to the fast-path UTC check ingetDatePartsInTimezone(), fixing date-part calculations for providers that use the canonicalEtc/UTCidentifier (common for crypto).ta.vwapSession Timezone: VWAP day-boundary detection now usesgetDatePartsInTimezone(openTime, syminfo.timezone)instead oftoISOString().slice(0, 10), so session resets are correct for non-UTC exchanges.