Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Question on Flow Designer transform string to date function.

Tate Roth
Tera Contributor

I am creating a flow to do a JDBC load from KACE and for some dates it uses a string format that looks like this;

 

Wed Mar 06 07:53:22 PST 2024

I have most everything else working, but I'm having an issue getting it to enter the date into a date field on the cmdb_ci_computer table.  The field is Date/Time and I am trying a String to Date transform on the data pill with the following custom format;

 

"EEE MMM DD HH:mm:ss 'CST' yyyy"

 

It does not seem to be working and in the execution, it looks like it's just trying to pass the string in with no modification.  Any tips or suggestions?

1 ACCEPTED SOLUTION

Try the following, it worked for me:

 

EEE MMM dd HH:mm:ss 'PST' yyyy
e.g.

JamesChun_0-1709760700094.png

 

 

View solution in original post

5 REPLIES 5

Sumanth16
Kilo Patron

Hi @Tate Roth ,

 

Please refer to below thread:

https://www.servicenow.com/community/developer-forum/date-conversion-problems/m-p/1698988

https://www.servicenow.com/community/developer-forum/error-in-flow-using-date-to-string-transform-fu...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

James Chun
Kilo Patron

Hey @Tate Roth,

 

Looks correct to me, but can you try removing the "" in the format?

i.e. EEE MMM DD HH:mm:ss 'CST' yyyy

 

Also, can you share how the date field is displayed in the target record?

 

Cheers

I had already tried that and I just did it again along with commenting out the EEE section by replacing it with 'Wed' instead so it looks like this. 

 

'Wed' MMM DD HH:mm:ss 'CST' yyyy

 

I get no entry in the field at all, since it doesn't match it leaves it empty or if it's an existing record, it leaves the old value.

 

Screenshot 2024-03-06 at 3.09.48 PM.png

Try the following, it worked for me:

 

EEE MMM dd HH:mm:ss 'PST' yyyy
e.g.

JamesChun_0-1709760700094.png