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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X