in reply to Best way to print out a particular date-time format (very specific)

Based on Recipe #13 in the Date::Calc docs, you can do:
use Date::Calc qw( Today_and_Now Month_to_Text ); my ($year,$month,$day, $hour,$min,$sec) = Today_and_Now(); printf "%02d%.3s%02d:%02d:%02d:%02d", $day, lc Month_to_Text($month), $year % 100, $hour, $min, $sec ;
  • Comment on Re: Best way to print out a particular date-time format (very specific)
  • Download Code

Replies are listed 'Best First'.
Re^2: Best way to print out a particular date-time format (very specific)
by kabeldag (Hermit) on Jun 09, 2006 at 08:36 UTC
    # Rough AEST Time. (Australian Eastern Standard Time) # Get GMTIME, then add zone incrament. # Best to define all zones in a hash or array or something, # and use the appropriate zone incrament depending on what # time zone you want to use/show. # # At least this is how I have always done it. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time); # GMTIME+AEST_TIME(10) my $zone_standard_hour=($hour+10);