LogoLogo
Back to HaasOnline.comSwitch to Trade Platform
3.x
3.x
  • Welcome
  • Getting Started
    • Using Local API Server
    • Authentication
    • Response
      • Error Codes
  • HaasScript
    • Using HaasScript
      • HaasScript Facts
      • Charting
      • Order Handling
      • Interval
      • Input Fields
      • Positions Handling
        • Fee correction
      • Position Information
      • Memory Management
      • Optimizations
      • Signal Handling
      • Trading
    • Script Editor
      • Syntax
      • Parameters
      • Interaction
    • Visual Editor
      • Blocks
      • Parameters
      • Flow Control
      • Interaction
    • Custom Commands
    • Tutorials
      • Trade Bot Guide
        • Creating A Trade Bot
          • Visual Editor Guide
          • Script Editor Guide
          • Custom Containers
        • Customizing Indicators
        • Customizing Safeties
        • Customizing Insurances
        • Creating Easy Indicators
      • Unmanaged Trading Guide
        • Executing Orders
        • Managing Orders
        • Managing Positions
        • Managing Wallet
      • Script Editor
        • Classes
        • MadHatter BBands
        • Percentage Price Change
      • Visual Editor
        • Importing Scripts
        • SmoothRSI
        • Scalper Bot
    • Commands
      • Array Helpers
      • Charting
      • Constants
      • Custom Commands Helpers
      • Easy Indicators
      • Easy Insurances
      • Easy Safeties
      • Equations
      • Flow Control
      • Input Fields
      • Input Settings
      • Mathematical
      • Memory Helpers
      • Miscellaneous
      • Order Handling
      • Order Information
      • Position Information
      • Position Prices
      • Price Data
      • Price Market Information
      • Profit Information
      • Settings
      • Signal Helpers
      • String Helpers
      • Technical Analysis
      • Technical Analysis Helpers
      • Time Information
      • Trade Actions (Managed)
      • Trade Actions (Unmanaged)
      • Trade Bot
      • Trade Market Information
      • Wallet
  • API Endpoints
    • Software API
    • Market Data API
    • Account Data API
    • Trade Data API
    • Advanced Order API
    • Trade Bot API
    • Custom Trade Bot API
    • ENUMS
    • Data Objects
  • Examples
    • Script Bots (C#)
      • Scalper Trade Bot
      • Flash Crash Trade Bot
    • Script Indicators (C#)
      • Indicator Script
      • Technical Analysis Library
    • Pshai Scripts (C#)
      • BBands Ext
      • BBands Ext v2
      • Chaikin A/D Line
      • Calibrator
      • Pshai's RVI
    • Scripted Driver
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Submit Support Ticket
Powered by GitBook
On this page
  • AdjustTimestamp
  • CreateTimestamp
  • CurrentDate
  • CurrentDay
  • CurrentHour
  • CurrentMinute
  • CurrentMonth
  • CurrentSecond
  • CurrentWeek
  • CurrentYear
  • MinutesTillCandleClose
  • Time

Was this helpful?

  1. HaasScript
  2. Commands

Time Information

AdjustTimestamp

Adjusts a Unix timestamp.

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

Returns the new Unix timestamp.

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

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

CreateTimestamp

Creates a Unix timestamp from the specified value.

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

Returns the Unix timestamp.

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

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.

  • CurrentDate([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentDay

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

  • 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

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentHour

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

  • CurrentHour([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentMinute

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

  • CurrentMinute([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentMonth

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

  • CurrentMonth([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentSecond

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

  • CurrentSecond([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentWeek

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

  • CurrentWeek([ unix ])

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

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

CurrentYear

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

  • CurrentYear([ unix ])

Returns the year.

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

unix

Number

False

Input, Number, SessionGet

MinutesTillCandleClose

Calculates the number of minutes before a new candle opens.

  • MinutesTillCandleClose(interval)

Returns the number of minutes before a new candle opens.

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

interval

Number

True

InputInterval, Number, CurrentInterval

Time

Gets the current unix timestamp. Based on UTC.

  • Time()

Returns the current unix timestamp.

Return Type: Number

PreviousTechnical Analysis HelpersNextTrade Actions (Managed)

Last updated 4 years ago

Was this helpful?