I wrote a perl script to get datetime. It do work but I do wonder if there any easier way to format date as output.
#!/usr/bin/perl use DateTime; my $dt
DateTime provides the format_cldr method for this:
format_cldr
use DateTime; my $myTimeStamp = DateTime->now->subtract( days => 1 ); printf "--> %s\n", $myTimeStamp->format_cldr('yyyy MM dd HH'); # --> 2012 02 28 02