toExternal Summary Constructs a new external Date object with the value of the internal Date object. Usage public override external toExternal() Returns A new external Date object with the same date and time. Description Constructs a new external Date object with the value of the internal Date object. Examples Basic Usage 1234567891011121314151617181920import System; external mysql = { query: function(q, a) { Console.log(q, a); } }; // Constrain type arguments to only classes that can convert to 'external'interface ICommand<T: IExportable>{ void execute(...T args);} class UpdateLastLogin : ICommand<Date>{ final void execute(...Date args) { auto d = (Date) args[0]; mysql.query("UPDATE `users` SET `last_login` = ? WHERE `id` = 1;", d.toExternal()); }} auto updateLastLoginCommand = new UpdateLastLogin();updateLastLoginCommand.execute(new Date()); Share HTML | BBCode | Direct Link