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
clojure (import 'java.util.Date)
(println (str (Date.)))
(import 'java.util.Date)
(println (str (Date.)))
cpp Qt 4.xQDate now = QDate::currentData();
qDebug() << now.toString();
#include <QDate>
#include <QDebug>
int main()
{
QDate now = QDate::currentData();
qDebug() << now.toString();
}
cpp time_t date = time(0);
cout << ctime(&date);
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
time_t date = time(0);
cout << ctime(&date);
return 0;
}
fantom echo(DateTime.now)
class SolutionXX
{
Void main()
{
echo(DateTime.now)
}
}
groovy println new Date()
println new Date()
Submit a new solution for
ruby,
clojure,
cpp,
fantom ...
There are 13 other solutions in
additional languages (
csharp,
erlang,
fsharp,
go ...)