LogoLogo
Back to HaasOnline.comSwitch to Developer API
4.x
4.x
  • Welcome
  • TradeServer Cloud
    • Overview
    • Security
    • Troubleshooting
  • TradeServer Enterprise
    • Overview
    • Updates
    • Security
    • Installation
      • Windows
      • MacOS
      • Linux
    • Configuration
      • License Key
      • Login credentials
      • Hosting
        • Linux VPS Hosting
    • Special features
      • Price history
      • Backups
      • Machine Learning
        • Built-in Machine Learning
        • Custom Machine Learning
      • Scripted Exchange API (Coming Soon)
      • Local API (Coming Soon)
    • Troubleshooting
  • Interface
    • General Interface
      • Left Menu
      • Upper Right Items
        • Account data
        • Execute trade
        • AI Chatbots
          • Chatbot Julia
          • Chatbot David
          • Chatbot Thomas
        • Notifications
        • Menu
          • Exchange accounts
          • Settings
          • License information
          • Change Logs
          • Logout
      • Status bar
        • Price tickers
    • Dashboard
    • Bots
      • Bot management
      • Bot templates
    • HaasScript
      • Web Editor
      • Backtest Lab
        • Lab test setup
      • Backtest History
      • Manage Scripts
      • Manage Signals
    • Tools
      • Marketview
      • Market intelligence
      • Exchange profiler
      • Markets explorer
      • News
    • Finance
      • Portfolio
      • External Wallet
  • Haasscript
    • About
      • Change Log
    • Tutorials
      • Bot building
        • Trade-bot building
        • Visual bot building
        • Scripted bot building
      • Usage
        • HaasScript
          • Interval
          • Markets
          • Input Fields
          • Memory Management
          • Signal Handling
          • Position Information
          • Positions Handling
            • Fee correction
          • Order Handling
          • Trading
          • Charting
          • Optimizations
        • Visual Editor
          • Blocks
          • Parameters
          • Flow Control
          • Interaction
        • Script Editor
          • Classes
        • Managed Trading
        • Unmanaged Trading
    • Commands
      • Trade Bots
        • TradeBot Containers
        • Easy Indicators
        • Easy Safeties
        • Easy Insurances
      • Helpers
        • Array Helpers
        • Custom Command Helpers
        • Enumerations
        • Equations
        • Mathematical
        • Memory Helpers
        • Signal Helpers
        • String Helpers
        • Miscellaneous
        • Technical Analysis Helpers
      • Input data
        • Bot Settings
        • Input fields
        • Price Market Information
        • Script Settings
        • Time Information
        • Trade Market Information
      • Prices
      • Technical Analysis
      • Charting
      • Trading
        • Managed Trade Commands
        • Unmanaged Trade Commands
        • Order Information
        • Order Handeling
        • Position Information
        • Position Price Information
        • Profit Information
        • Wallet Information
      • Social Media
    • Built-in Bots
      • Version 3 bots
        • C# Scripted Bot
        • Email bot
        • Trendline Bot
        • Triangle Arbitrage Bot
      • Accumulation Bot
      • Enhanced RSI bot
      • FlashCrash (Grid) Bot
      • Crypto Index Bot
      • Intellibot Alice
      • Inter Exchange Arbitrage Bot
      • MadHatter Bot
      • Market Making Bot
      • Order Bot
      • PingPong Bot
      • Scalper bot
      • Zone-Recovery Bot
    • Community Bots
      • Simple Grid Bot (SPOT)
      • Simple Grid Bot (FUTURES)
      • Simple Market Maker (SPOT)
      • Simple Market Maker (FUTURES)
  • Usage
    • First Usage
    • Setup Exchange
      • Adding an API to the Platform
      • Binance
      • Binance US
      • Bit2me
      • Bitfinex
      • Bitget
      • BitMEX
      • ❌Bitpanda
      • Bitstamp
      • ❌Bittrex
      • Bybit
      • ❌Cex.IO (Legacy API)
      • ❌Coinbase
      • ❌Crypto.com
      • Deribit
      • Gemini
      • Gleec
      • ❌HitBTC
      • Huobi
      • ❌Ionomy
      • Kraken
      • Kraken Futures
      • KuCoin
      • KuCoin Futures
      • LBank
      • ❌OKCoin
      • OKX
      • OKX-Futures
      • OKX-Swap
      • Phemex
      • Poloniex
      • Poloniex Futures
      • WooX
    • Setup Telegram Notification Bot
    • Setup Discord Notification Bot
    • Use Signals
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Submit Support Ticket
Powered by GitBook
On this page
  • AdjustTimestamp
  • CloseTime
  • CreateTimestamp
  • CurrentDate
  • CurrentDay
  • CurrentHour
  • CurrentMinute
  • CurrentMonth
  • CurrentSecond
  • CurrentWeek
  • CurrentYear
  • FormatDateTime
  • GetTimer
  • MinutesTillCandleClose
  • OpenTime
  • StartTimer
  • StopTimer
  • Time

Was this helpful?

  1. Haasscript
  2. Commands
  3. Input data

Time Information

AdjustTimestamp

Adjusts an Unix timestamp.

Syntax: AdjustTimestamp([ unix ], [ addSeconds ], [ addMinutes ], [ addHours ], [ addDays ], [ addMonths ], [ addYears ])

Returns the new Unix timestamp.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

addSeconds

Number

False

Input,Number,SessionGet

addMinutes

Number

False

Input,Number,SessionGet

addHours

Number

False

Input,Number,SessionGet

addDays

Number

False

Input,Number,SessionGet

addMonths

Number

False

Input,Number,SessionGet

addYears

Number

False

Input,Number,SessionGet

CloseTime

Converts a timestamps to the close timestamp of the candle.

Syntax: CloseTime(unix, interval)

Returns the close timestamp of the candle.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

True

Input,Number,SessionGet

interval

Number

True

InputInterval,Number,CurrentInterval

CreateTimestamp

Creates an Unix timestamp from the specified value.

Syntax: CreateTimestamp([ year ], [ month ], [ day ], [ hour ], [ minute ], [ second ])

Returns the Unix timestamp.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

year

Number

False

Input,Number,SessionGet

month

Number

False

Input,Number,SessionGet

day

Number

False

Input,Number,SessionGet

hour

Number

False

Input,Number,SessionGet

minute

Number

False

Input,Number,SessionGet

second

Number

False

Input,Number,SessionGet

CurrentDate

Gets the date of the month of the current time or requested time. Based on UTC.

Syntax: CurrentDate([ unix ])

Returns the date of the month value. A number from 1 to 31.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentDay

Gets the day of the week of the current time or requested time. Based on UTC.

Syntax: CurrentDay([ unix ])

Returns the day of the week value. A number from 1 to 7, starting on Sunday.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentHour

Gets the hour the current time or requested time. Based on UTC.

Syntax: CurrentHour([ unix ])

Returns the hour value. A number from 0 to 23.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentMinute

Gets the minute the current time or requested time. Based on UTC.

Syntax: CurrentMinute([ unix ])

Returns the minute value. A number from 0 to 59.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentMonth

Gets the month of the year of the current time or requested time. Based on UTC.

Syntax: CurrentMonth([ unix ])

Returns the month of the year value. A number from 1 to 12.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentSecond

Gets the second the current time or requested time. Based on UTC.

Syntax: CurrentSecond([ unix ])

Returns the second value. A number from 0 to 59.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentWeek

Gets the week of the year of the current time or requested time. Based on UTC.

Syntax: CurrentWeek([ unix ])

Returns the week of the year value. A number from 1 to 53.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

CurrentYear

Gets the year the current time or requested time. Based on UTC.

Syntax: CurrentYear([ unix ])

Returns the year.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Input,Number,SessionGet

FormatDateTime

Formats a unix datetime number (to "YYYY-MM-DD at HH:MM" by default).

Syntax: FormatDateTime([ unix ], [ dateDelimiter ], [ dateTimeDelimiter ], [ timeDelimiter ], [ includeSeconds ], [ includeTime ], [ includeYear ])

The formatted unix datetime number.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

False

Time

dateDelimiter

String

False

Text

dateTimeDelimiter

String

False

Text

timeDelimiter

String

False

Text

includeSeconds

Boolean

False

True,False

includeTime

Boolean

False

True,False

includeYear

Boolean

False

True,False

GetTimer

Gets the elapsed time for a timer.

Syntax: GetTimer([ key ])

Returns the elapsed time in milliseconds.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

key

String

False

Text,Input,SessionGet,Load

MinutesTillCandleClose

Calculates the number of minutes before a new candle opens.

Syntax: MinutesTillCandleClose(interval)

Returns the number of minutes before a new candle opens.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

interval

Number

True

InputInterval,Number,CurrentInterval

OpenTime

Converts a timestamps to the open timestamp of the candle

Syntax: OpenTime(unix, interval)

Returns the open timestamp of the candle.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

unix

Number

True

Input,Number,SessionGet

interval

Number

True

InputInterval,Number,CurrentInterval

StartTimer

Starts a timer.

Syntax: StartTimer([ key ])

Return type: Void

Parameter Name
Parameter Type
Required
Suggestions

key

String

False

Text,Input,SessionGet,Load

StopTimer

Stops a timer.

Syntax: StopTimer([ key ])

Returns the elapsed time in milliseconds.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

key

String

False

Text,Input,SessionGet,Load

Time

Gets the current unix timestamp. Based on UTC.

Syntax: Time()

Returns the current unix timestamp.

Return type: Number

PreviousScript SettingsNextTrade Market Information

Last updated 1 year ago

Was this helpful?