RE: get the date from string
The date and time can be different on the client and the server.
You will not typically need to format a date to a string. Use date fields, variables, and date controls on forms and reports instead.
If you need to format a date to a string:
For user interface situations, use strFmt or date2Str with -1 in all the formatting parameters. This ensures that the date is formatted in the way that the user has specified in Regional Settings.
For other specific system-related situations, such as communication with external systems, use date2Str.
When you let Regional Settings dictate the format, be aware that it can change from user to user and might not be a suitable format for external communication.
Using str2Date indicates that dates are being used that have had a string format.