On Monday, November 24, 2014 10:38:55 Suliman via Digitalmars-d-learn wrote: > And could anybody explain me how the cast is work. How to > understand which types to which may be casted?
Look at the documentation for opCast. That's how the casting is done. But what it comes down to is SysTime -> DateTime, Date, or TimeOfDay DateTime -> Date or TimeOfDay Those are the conversions which lose information, so they can be done via casts, whereas the conversions that would increase the amount of information in the type require using a constructor, because you have to use information from multiple objects to be able to create the new object. e.g. auto dt = DateTime(date, tod); The primary reason to cast a SysTime to a Date prior to calling toISOExtString on it is to strip off the time portion, but slicing the result as uri suggested works too (though it's probably a tad less efficient due to the time spent creating the portion of the string that isn't even used). - Jonathan M Davis