Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show seconds on parameter prompt?

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

    Show seconds on parameter prompt?

    Scenario: I have a datetime field as an input parameter. I default it to the current datetime (private DateTime resetTime = DateTime.Now to get a base time format to display. For example it will show "4/10/2014 12:18 AM" on the indicator prompt window. I can change the value to "4/10/2014 12:18:05" to pass seconds and it works.

    Question: Can it be made display the seconds on the prompt? example: "4/10/2014 12:18:05"?

    #2
    Hi ct,

    string.Format is your friend..

    check the link for a more detailed instruction on DateTime formatting
    Learn to use custom date and time format strings to convert DateTime or DateTimeOffset values into text representations, or to parse strings for dates & times.


    good Luck

    Comment


      #3
      ct, you probably look for something like this -

      private string myInputTime = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      87 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      106 views
      0 likes
      Last Post CarlTrading  
      Working...
      X