Questions/suggestions about Date.Set()

Hi.

  1. According to the manual, you can set a date using Date.Set() with a string like yyyy-mm-dd hh:mm:ss.mmm. But it seems Set() doesn't like milliseconds.
    e.g.
var regex = /^(?:(0?[1-9]|[12][0-9]|3[01])[-/](0?[1-9]|1[0-2])[-/]((?:1[6-9]|2[0-9])\d{2})(?:\s(0?\d|1\d|2[0-3]):([0-5]?\d)(?::([0-5]?\d)(?:\.(\d{1,3}))?)?)?|((?:1[6-9]|2[0-9])\d{2})[-/](0?[1-9]|1[0-2])[-/](0?[1-9]|[12][0-9]|3[01])(?:\s(0?\d|1\d|2[0-3]):([0-5]?\d)(?::([0-5]?\d)(?:\.(\d{1,3}))?)?)?)$/;
var str = '1991-12-31 02:59:01.100';
DOpus.Output('Valid:'+regex.test(str));
var date = DOpus.Create().Date();
date.Set(str); //error when ms are present
DOpus.Output(date.Format('','nSM'));

Without milliseconds it works fine.

  1. Although you can use regex to validate the format of a datetime, there are certain things you can't do, like validate the value itself. Since it seems Date.Set() throws an error when you pass an incorrect one (correct me if I'm wrong, please), could it be changed to return true/false instead as a validation method?

Thanks.

The string 'now' is not working either.

Fixed in the next beta.