Issue with a drawing_date attribute, unable to set date when its 2 digit date and month without a leading zero

It works fine from the UI side, but does not work from Powershell script side.

I can't seem to set value to a date attribute when its 2 digit date and 2 digit month without a leading zero.

Update-PWDocumentAttributes -InputDocuments $stagingDoc -Attributes @{​​Drawing_Date = $drawingDate}​​

It will just set it to blank. 

 

The date variable used to assign dates is in “System.DateTime”  datatype.

We get ‘Creation Date’ set to blank when there is double digit ‘day number’ and double digit ‘month number’, every other case works fine.

 Testing result. (only revision date was to be set in the drawing_date attribute) you can see sometimes it works else it is not set, where BLANK is mentioned.

Creation Date

Sheet Issue Date

Revision Date

Date in Staging Area, just before the move command is called

Date in Hashtable

Date in FLC folder after its moved.

BLANK

5/23/19

12/20/19

BLANK

12/20/2019

BLANK

BLANK

5/23/19

2/3/19

2/3/2019

2/3/2019

2/3/2019

BLANK

5/23/19

12/10/19

BLANK

12/10/2019

BLANK

BLANK

5/23/19

12/9/19

12/9/2019

12/9/2019

12/9/2019

BLANK

5/23/19

12/09/19

12/9/2019

12/9/2019

12/9/2019

BLANK

5/23/19

1/19/19

1/19/2019

1/19/2019

1/19/2019

BLANK

5/23/19

01/19/19

1/19/2019

1/19/2019

1/19/2019

BLANK

5/23/19

1/19/2019

1/19/2019

1/19/2019

1/19/2019

BLANK

5/23/19

01/19/2019

1/19/2019

1/19/2019

1/19/2019

BLANK

5/23/19

10/19/2019

BLANK

10/19/2019

BLANK

BLANK

5/23/19

10/19/19

BLANK

10/19/2019

BLANK