On 10/07/07, Tracey <[EMAIL PROTECTED]> wrote:
Difficult.

I use a javascript calendar picker to populate dates formatted dd/MM/yyyy
(user requirements) which is passed via "textbox.value" to a javascript
function which in turn passes the value directly back to my Delphi app.


Good Afternoon Tracey,

Could you use EncodeDate(), which will ensure that you are passing the
actual date as you would like. E.g. ...

// sDate = your date string = dd/mm/yyyy = '10/07/2007'
// d, m, y : Word;
Try
   d := StrToInt(copy(sDate, 1, 2));
   m := StrToInt(copy(sDate, 4, 2));
   y := StrToInt(copy(sDate, 7, 4));
   MyDate := EncodeDate(y, m, d);
except
   ShowMessage('Not a date');
end;

Steve
--
Steve Peacocke
http://stevepeacocke.blogspot.com/
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to