Create a Date object representing the current date and time. Print it out.
If you can also do this without creating a Date object you can show that too.
ruby puts DateTime.now
puts DateTime.now
csharp // Creating a variable first:
DateTime now = DateTime.Now;
Console.WriteLine(now);
// Without creating a variable:
Console.WriteLine(DateTime.Now);
// Creating a variable first:
DateTime now = DateTime.Now;
Console.WriteLine(now);
// Without creating a variable:
Console.WriteLine(DateTime.Now);
fantom echo(DateTime.now)
class SolutionXX
{
Void main()
{
echo(DateTime.now)
}
}
clojure (import 'java.util.Date)
(println (str (Date.)))
(import 'java.util.Date)
(println (str (Date.)))
Submit a new solution for
ruby,
csharp,
fantom, or
clojure
There are 15 other solutions in
additional languages (
cpp,
erlang,
fsharp,
go ...)