Pages

Friday, December 14, 2012

Get current time in perl

#!/usr/bin/perl -w

print "current time in epoch is : ". time(). "\n";
print "current time is : ". localtime(time()). "\n";

my ($sec,$min,$hour,$day,$month,$yr19,@rest) =   localtime(time);

print "----------------------------------------\n";
print "Sec : ". $sec . "\n";
print "Min : ". $min . "\n";
print "Hour : ". $hour . "\n";
print "Day : ". $day . "\n";
print "Month : ". $month . "\n";
print "Year : ". $yr19 . "\n";
Output
current time in epoch is : 1355483046
current time is : Fri Dec 14 16:34:06 2012
-------------------------------------------
Sec : 6
Min : 34
Hour : 16
Day : 14
Month : 11
Year : 112

12 comments:

  1. Good information. Lucky me I recently found your
    site by chance (stumbleupon). I have book marked it for
    later!
    Feel free to surf my website :: neck pain

    ReplyDelete
  2. Keep this going please, great job!
    My web-site - property management los angeles

    ReplyDelete
  3. Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the website is also very good.
    Here is my web-site ; Trick Photography and Special Effects

    ReplyDelete
  4. I'm now not sure where you are getting your information, but great topic. I must spend a while finding out much more or understanding more. Thank you for magnificent info I was on the lookout for this information for my mission.
    Also see my site > Upper James Manor - Greg Iacomo

    ReplyDelete
  5. My brother suggested I might like this blog. He was entirely right.
    This post truly made my day. You cann't imagine just how much time I had spent for this info! Thanks!
    my webpage: Excellent Benefits

    ReplyDelete
  6. Simply wish to say your article is as surprising.
    The clarity on your post is simply cool and that i can think you're knowledgeable on this subject. Well together with your permission allow me to grab your RSS feed to keep updated with coming near near post. Thank you one million and please keep up the gratifying work.

    my blog post domains for sale

    ReplyDelete
  7. What's up, just wanted to tell you, I loved this post. It was helpful. Keep on posting!

    My homepage - fake people quotes

    ReplyDelete
  8. Hiya! Quick question that's completely off topic. Do you know how to make your site mobile friendly? My blog looks weird when viewing from my iphone. I'm trying to find a
    theme or plugin that might be able to correct this issue.

    If you have any recommendations, please share. With thanks!



    Also visit my blog :: salt lake locksmith

    ReplyDelete
  9. Hi! I could have sworn I've been to this website before but after browsing through a few of the posts I realized it's new to me.
    Anyhow, I'm certainly happy I stumbled upon it and I'll be bookmarking it and checking back regularly!


    Here is my weblog; www.cleanserv.co.za

    ReplyDelete
  10. Thanks for some other informative site. Where else may I am
    getting that kind of info written in such a perfect
    method? I have a mission that I am just now running
    on, and I've been on the look out for such information.

    Feel free to surf to my site ... mzansi carpet cleaners

    ReplyDelete
  11. Hi there! Do you know if they make any plugins to help with Search Engine Optimization?
    I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good
    success. If you know of any please share.
    Kudos!

    Here is my webpage: Californian love

    ReplyDelete
  12. Excellent post. I will be dealing with a few of these issues as well.

    .

    My web-site: dance

    ReplyDelete