Convert text to Date

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Convert text to Date

Postby bobm » Wed Jun 26, 2019 7:51 pm

I have a string made of calculated components that I need to convert to a Date format.

the three variables would be the Month / Day / Year
an example of the variable created is "7/28/2020"
the "7/28/2020" is what I need to convert to a Date format

I've tried: utils.parseDate(variable, EEE, MM/dd/yyyy) but it returns NULL

Thank you,
Bob
Bob Mezzadri
EyeCOR By Nteon
bobm
 
Posts: 81
Joined: Thu Dec 29, 2011 8:24 pm

Re: Convert text to Date

Postby Ruben79 » Thu Jun 27, 2019 9:12 am

Not sure if I understand correctly but isn't this what you need? Just put the format parameter also as a string?
Code: Select all
utils.parseDate("7/28/2020", "MM/dd/yyyy")
Ruben de Jong
Stb Software Development
SAN Partner

Stb Software Development - http://www.stb.nl
User avatar
Ruben79
 
Posts: 97
Joined: Wed Apr 18, 2007 12:43 pm

Re: Convert text to Date

Postby bobm » Thu Jun 27, 2019 2:30 pm

Ruben,

Thank you! The issue was the leading 'EEE' prior to the date format.

Bob
Bob Mezzadri
EyeCOR By Nteon
bobm
 
Posts: 81
Joined: Thu Dec 29, 2011 8:24 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 9 guests