Home Analyst Portal

Date picker in request form returns wrong date

Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
Hi, I have a request offering form where I use a date field. When the end user selects a date, for example April 30th 2018, it is displayed as 4/30/2018 12:00 AM. When I map this to for example the title, this date string is copied.

However, when I check the UserInput field, it is modified and stored as 2018-04-29 22:00:00 UTC". I need to add an SMA script in which I want to do something based on the date and there I'm also stuck with the wrong converted date.

Any ideas how I can get around this ? Obviously I want to work with the date that the end user selected.


Best Answer


  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    Thanks Adam,
     The UserInput field contains the correct data, but when it is run through the Get-SCSMWorkItemUserInput cmdlet the date is no longer correct. So I'll have to re-parse it from the original UserInput field on the SR.

  • Stephane_BouillonStephane_Bouillon Customer Adept IT Monkey ✭✭
    I finally decided to parse the UserInput xml myself rather than relying on the Get-SCSMWorkItemUserInput cmdlet, this way I could handle the date field(s) correctly from the start. Thanks for your help Adam.
  • Marek_LefekMarek_Lefek Customer Advanced IT Monkey ✭✭✭

    So to have a proper time in eg. Title field I need to create runbook ? Aren't there any easier way?

Sign In or Register to comment.