std_time is a full calendar for Pine Script v6: the class of time infrastructure other ecosystems get from java.time, C++20 chrono and exchange_calendars, written natively in Pine. Civil dates, durations and periods, time zones with real daylight-saving rules, twelve exchange calendars (NYSE, LSE, CME, JPX, EUREX, HKEX, ASX, TSX, SSE, BSE, SGX, and 24/7 crypto) with holidays, half days and lunch breaks, trading-day arithmetic, sessions with on-the-bar close markers, option expiries including VIX settlement, ISDA day counts and business-day conventions, an economic release calendar, and an ISO-8601 formatter and parser. A calendar, not a bag of helpers.
One conversion sits at the bottom: Hinnant's civil-to-epoch pair, the algorithm C++20 chrono adopted. Weekdays, ISO weeks, DST boundaries, adjusters and holiday rules all derive from it, so no second implementation exists to quietly disagree with the first. The API keeps calendar arithmetic and instant arithmetic as separate families, because plus one day across a clock change is not plus 24 hours, and it treats an offset and a zone as different things, because they are. When a DST transition makes a local time impossible or ambiguous, you choose the resolution policy instead of inheriting one.
Rules do the work wherever the world runs on rules: VIX settlement is derived, not tabled, and reproduces every published Cboe settlement from 2021 through 2026, including all four Tuesday exceptions. The calendars are checked date-by-date against reference records over their stated ranges: NYSE and LSE on every single day from 1976 to 2035, HKEX through 2049, EUREX across its full window with zero differences. Every calendar declares the years it answers exactly, and past that horizon it returns UNKNOWN, a real three-valued answer, rather than reading an untabled holiday as a trading day. Completeness is a claim with a date on it, and every calendar states its date.
Full documentation, per-calendar coverage windows, the error model, and design rationale: github.com/hikari112/std_time/wiki
One conversion sits at the bottom: Hinnant's civil-to-epoch pair, the algorithm C++20 chrono adopted. Weekdays, ISO weeks, DST boundaries, adjusters and holiday rules all derive from it, so no second implementation exists to quietly disagree with the first. The API keeps calendar arithmetic and instant arithmetic as separate families, because plus one day across a clock change is not plus 24 hours, and it treats an offset and a zone as different things, because they are. When a DST transition makes a local time impossible or ambiguous, you choose the resolution policy instead of inheriting one.
Rules do the work wherever the world runs on rules: VIX settlement is derived, not tabled, and reproduces every published Cboe settlement from 2021 through 2026, including all four Tuesday exceptions. The calendars are checked date-by-date against reference records over their stated ranges: NYSE and LSE on every single day from 1976 to 2035, HKEX through 2049, EUREX across its full window with zero differences. Every calendar declares the years it answers exactly, and past that horizon it returns UNKNOWN, a real three-valued answer, rather than reading an untabled holiday as a trading day. Completeness is a claim with a date on it, and every calendar states its date.
Full documentation, per-calendar coverage windows, the error model, and design rationale: github.com/hikari112/std_time/wiki
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
