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, 05-11-2026, 05:56 AM
      0 responses
      25 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      19 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      182 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      335 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      259 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X