How can I convert a date that the user enters into a GuiXT field to the date format in user defaults?

Carry out an update; version 2004 Q4 4 and upwards contains a "-date" option for InputFields.

With older versions you can use the following coding:

// GuiXT script, example

InputField (0,0) "Date" (0,10) size=10 name="dx" 

// InputScript

// Date difference

Set V[diff_today]  "&V[dx]"  - "&V[today_y/m/d]"

// Date,  format d.m.y

Set V[d2]  "&V[today_d.m.y]"  + "&V[diff_today]"

// Date,  format y.m.d

Set V[d3]  "&V[today_y.m.d]"    + "&V[diff_today]"

// Difference

Set V[diff0]  "&V[d2]"  - "&V[d3]" 

if not V[diff0=0]

  Message "E: Date '&V[dx]' not valid"   -statusline


  // Date, user format

Set V[dx]  "&V[today_user]"  + "&V[diff_today]"