Announcement

Collapse
No announcement yet.

Problem with calling various times

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with calling various times

    Hello,

    i thought calling rawtime(0) would give me the number of seconds elapsed since 1/1/1970 - with the code applied to a daily chart does this give the number of seconds to the start of the daily bar or the end of the daily bar, or current time of daily bar? cant work it out!

    second question is: when im calling the number of millisecs elapsed from 1/1/1970 to a specific date like 26th august 2008, using this code (ie new Date(2008, 8, 26) does this code give me the number of millisecs up until the start or end of 26th aug 2008? ie at 8/26/2008 00:00:00 or 8/26/2008 23:59:00 or up to some other time of the daily bar?

    this is the code im using and having problems with, i thought that the 2 times (in milliseconds) shown in the formula output window should be the same, but they are 30.5 days or a month apart, why is this the case? code im using is attached below.

    thank you for any help.

    regards

    rod
    Last edited by Rocket130713; 08-26-2008, 05:30 AM.

  • #2
    Re: Problem with calling various times

    Originally posted by Rocket130713
    Hello,

    i thought calling rawtime(0) would give me the number of seconds elapsed since 1/1/1970 - with the code applied to a daily chart does this give the number of seconds to the start of the daily bar or the end of the daily bar, or current time of daily bar? cant work it out!

    second question is: when im calling the number of millisecs elapsed from 1/1/1970 to a specific date like 26th august 2008, using this code (ie new Date(2008, 8, 26) does this code give me the number of millisecs up until the start or end of 26th aug 2008? ie at 8/26/2008 00:00:00 or 8/26/2008 23:59:00 or up to some other time of the daily bar?

    this is the code im using and having problems with, i thought that the 2 times (in milliseconds) shown in the formula output window should be the same, but they are 30.5 days or a month apart, why is this the case? code im using is attached below.

    thank you for any help.

    regards

    rod
    Attached Files

    Comment


    • #3
      Re: Problem with calling various times

      Rod

      i thought calling rawtime(0) would give me the number of seconds elapsed since 1/1/1970 - with the code applied to a daily chart does this give the number of seconds to the start of the daily bar or the end of the daily bar, or current time of daily bar? cant work it out!
      rawtime(0) returns the time stamp of the bar expressed in seconds elapsed since January 1st, 1970
      In eSignal the time stamp of a bar represents the beginning of the interval (or in the case of tick based intervals the time the bar was formed)
      As an aside you can easily convert the value returned by rawtime into "readable time" by using one of the many online Unix time converters that are available on the net

      second question is: when im calling the number of millisecs elapsed from 1/1/1970 to a specific date like 26th august 2008, using this code (ie new Date(2008, 8, 26) does this code give me the number of millisecs up until the start or end of 26th aug 2008?
      Actually that will give you the time in milliseconds to the start of September 26, 2008. You can verify this by using the .toString() method on your Date Object which will return the complete date and time.

      ... i thought that the 2 times (in milliseconds) shown in the formula output window should be the same, but they are 30.5 days or a month apart, why is this the case?
      See my reply to the previous question
      Also if you try searching the forum for keywords such as Date Object or rawtime* you should find several examples of time manipulation and on the use of the Date Object. I would also suggest that you review the documentation on time functions which is provided in the EFS KnowledgeBase
      Alex


      Originally posted by Rocket130713
      Hello,

      i thought calling rawtime(0) would give me the number of seconds elapsed since 1/1/1970 - with the code applied to a daily chart does this give the number of seconds to the start of the daily bar or the end of the daily bar, or current time of daily bar? cant work it out!

      second question is: when im calling the number of millisecs elapsed from 1/1/1970 to a specific date like 26th august 2008, using this code (ie new Date(2008, 8, 26) does this code give me the number of millisecs up until the start or end of 26th aug 2008? ie at 8/26/2008 00:00:00 or 8/26/2008 23:59:00 or up to some other time of the daily bar?

      this is the code im using and having problems with, i thought that the 2 times (in milliseconds) shown in the formula output window should be the same, but they are 30.5 days or a month apart, why is this the case? code im using is attached below.

      thank you for any help.

      regards

      rod

      Comment

      Working...
      X