How do I convert a string to a date

  • 11 December 2016
  • 5 replies
  • 6 views

Badge +9

I have a string variable that has the month,day, and year (eg.01/01/2016) and I am trying to Convert the string variable into a date using the Convert Value, but I keep getting the year 1900, eg. 01/04/1900..

Why is this occuring.....

Note my sequence is

1-Using Build String

   fn-FormatDate({DueDate},MM)/01/fn-FormatDate({DueDate},yyyy) which is stored in a variable called    strFirstDayOfTheMonth

2-Using ConvertValue

   Input is strFirstDayOfTheMonth

   Store Result in dtFirstDayOfTheMonth (date variable)

What am I doing wrong

   


5 replies

Badge +5

If you log the variable strFirstDayOfTheMonth to the Workflow History list before and after you convert the variable to date, whats the output in the history log?

Badge +9

I will check tomorrow and let you know..thx

Badge +9

Actually can you send me a screenshot of the below..the file will get rejected at my work site..Or if you can tell me some sandbox on the internet where I can review what you sent me that would be great..thx again

Userlevel 5
Badge +14

how have you configured date format in convert value action?

it looks like single parts are misinterpreted.

Badge +9

It turns out I had a date variable further down that was not set thus the reason for 1900.  Thanks Shane for the advice on logging the date.  I wish I knew about that yesterday as it would have saved me hours !

Reply