twingall

TimeFormattingLibrary

Library "TimeFormattingLibrary"
Time formatting functions: formating functions to make timestrings more human readable friendly (for both fixed time and time-elapsed).
Also functions for last and first instance in month of day of week input.
Also a function for identifying bank holiday Mondays.

timeFormatFxn(showDayOfWeek, showDayOfMonth, showMonth, showYear, showHrMin, _time, _timezone)
  converts time into readable format
  Parameters:
    showDayOfWeek (bool): if you want to show day of week (i.e. Mon, Tues etc)
    showDayOfMonth (bool): if you want to show day number of month with superscript ordinals (i.e. 1ˢᵗ, 2ⁿᵈ, etc)
    showMonth (bool): if you want to show the month (i.e. Jan, Feb, etc)
    showYear (bool): if you want to show the year (i.e. 2023)
    showHrMin (bool): if you want to show time in 24hr clock format
    _time (int): is the unix time (i.e. time or time_close)
    _timezone (string): the user timezone input as string (e.g. "America/New_York", "UTC-5", "GMT+0530")
  Returns: time date string

timeElapsedFxn(timespan)
  converts timespan into readable format
  Parameters:
    timespan (int): is the length of time in milliseconds to be converted into a human readable string
  Returns: timespan string (whether it be a for showing 'time-elapsed' or for showing a 'countdown timer')

isFirstXdayofmonth(_dayofweek)
  gives bool result for when first occurence in month of the day-of-week input
  Parameters:
    _dayofweek (int): (can be integer 1-7 or can be dayofweek variable; i.e. dayofweek.wednesday)

isLastXdayofmonth(_dayofweek)
  gives bool result for when last occurence in month of the day-of-week input
  Parameters:
    _dayofweek (int): (can be integer 1-7 or can be dayofweek variable; i.e. dayofweek.wednesday)

wasBankHolidayMonday()
  gives bool result for if yesterday was a bank holiday monday. Only for use with with request.security() function, see example code below

You can buy me a coffee here...

PayPal.Me/twingall
BTC: 3JrhUwNRnKyqhaa1n1AXKeAubNeEFoch6S
ETH erc20: 0x4b0400B1c18503529ab69611e82a934DDe4Ab038
ETH bep20: 0x1F0f03F184079bb1085F8C9dF3a8191C9f5869B3
ไลบรารีไพน์

จิตวิญญาณที่แท้จริงของ TradingView ผู้เขียนได้ตีพิมพ์รหัส Pine นี้เป็นไลบรารีโอเพนซอร์ซเพื่อให้โปรแกรมเมอร์คนอื่น ๆ จากชุมชนของเราสามารถนำไปใช้ซ้ำได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ไลบรารีนี้เป็นการส่วนตัวหรือในสิ่งพิมพ์โอเพนซอร์สอื่น ๆ แต่นำรหัสนี้มาใช้ซ้ำในสิ่งพิมพ์จะถูกควบคุมโดย กฎระเบียบการใช้งาน

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการใช้ไลบรารีนี้หรือไม่?

คัดลอกข้อความไปยังคลิปบอร์ดแล้ววางลงในสคริปต์ของคุณ