Hi,
Yes this is possible. But, before answering, let me put one thing straight: milliseconds can be (1) a measure of duration, not something used to define a date; (2) the number of milliseconds present in one date as a field (like the number of seconds, minutes, hours, etc. in that date).
All models come with two default variables: starting_date and current_date. Yo can redefine the first one, for example if you want to start a simulation at a given date. Various operators allow you to handle their modification (adding durations, etc.), incl. arithmetic operators (i.e. you can write date2 <- date1 + 1 #month + 23 #ms).
Some pseudo-constants also exist, like #now (which gives the current « machine » date) or #epoch (which gives the default starting date of models when none is defined, and which can be changed in the preferences — by default it is the 1st of January 1970, like in Java).
Now, to answer your questions:
1) • create a new date with milliseconds value : I dont really understand what this means. You cannot create a date from a duration, unless you have some sort of starting point (in which, your date would be x milliseconds after the starting point, maybe, if this is what you intend to obtain ?). For instance, date d1 <- starting_date plus_ms 100; could give you a date after 100ms of the starting date of the model; or date d2 <- #now plus_ms 1000; would give you a date ahead of 1s after the current machine date.
2) • compare two dates considering milliseconds value: again, you have to make it clearer. Do you want to obtain the difference (i.e. duration) of two dates in milliseconds (in which case, milliseconds_between(d1,d2) is your friend) or do you want to compare the values of the milliseconds field of each date ?
3) • get current simulation date with milliseconds. Again, it does not mean anything by itself, unless you mean the duration in milliseconds from a given starting date (for instance, milliseconds_between(d1, starting_date) will give you the amount of milliseconds between your date and the starting_date of the model).
Please tell me if I answered your questions or not — and in that case, please precise them (maybe with examples).
Cheers
Alexis
Senior Researcher, co-director, UMI UMMISCO 209, IRD & UPMC, France. http://ummisco.fr