Unix Timestamp Converter
Convert whole Unix seconds to a UTC date and back. Pine Script uses milliseconds: multiply this tool's seconds by 1,000 before using them as Pine time values.
Quick Reference
What is a Unix Timestamp?
A Unix timestamp (also called Unix epoch time, Unix time, or POSIX time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC. This date is known as the Unix epoch and is the starting point of Unix time.
Unix timestamps are widely used in computer systems, databases, and programming languages because they provide a simple, integer- based representation of time that is easy to store, compare, and manipulate.
Why Pine Script Developers Need This Tool
Pine Script, the programming language used for TradingView strategies and indicators, frequently uses Unix timestamps for:
- Time-based conditions: Filtering trades or signals by specific dates and times
- Session filtering: Running strategies only during specific trading sessions
- Historical data analysis: Backtesting strategies over specific time periods
- Time functions: Using
timestamp(),time, andtime_closefunctions in your scripts
Common Timestamp Values
| Event | Timestamp | Date |
|---|---|---|
| Unix Epoch Start | 0 | 1970-01-01 00:00:00 UTC |
| Year 2000 | 946684800 | 2000-01-01 00:00:00 UTC |
| Start of 2024 | 1704067200 | 2024-01-01 00:00:00 UTC |
| Leap Day 2024 | 1709164800 | 2024-02-29 00:00:00 UTC |
Frequently Asked Questions
What is the current Unix timestamp?
The current Unix timestamp is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC. You can see the current timestamp when this page loads. Use the refresh button to update it; it is not a continuously ticking clock.
Is Unix timestamp in seconds or milliseconds?
The standard Unix timestamp is in seconds. However, some systems (like JavaScript) use milliseconds. To convert between them, multiply seconds by 1,000 to get milliseconds, or divide milliseconds by 1,000 to get seconds.
How do I use timestamps in Pine Script?
Pine Script's timestamp(), time and time_close use milliseconds. Calendar arguments default to the symbol's exchange time zone unless an explicit time zone is supplied. See TradingView's time documentation before transferring values between systems.
Does the timestamp account for timezone?
Unix timestamps are always in UTC—they represent an absolute moment in time regardless of timezone. When converting back to readable format, the time zone affects the displayed date and clock time. This tool interprets all date inputs as UTC.
Build Custom Indicators for Your Timestamp Strategies
Use our AI-powered Pine Script generator to create custom indicators and strategies that react to specific dates, times, and events. No coding required—just describe what you need.
Related Tools
Pine Script Indicator Generator
Explore Pine Script indicator generation and review the resulting code for your TradingView chart.
Backtesting Calculator
Explore a repeatable synthetic portfolio simulation with allocation weights and calendar rebalancing; no historical market prices are used.
RSI Calculator
Calculate the Relative Strength Index to identify overbought or oversold conditions.