Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    January 18th, 2005
    Posts
    58
    Convert Unix timestamp to date
    Does anyone have a perl code snippet to convert a unix timestamp to a date.
    Some thing like the perl equivlant to the php function
    Code:
    getdate(1029301200)

  2. #2
    Fear and Arrogance jrrl's Avatar
    Join Date
    January 18th, 2005
    Location
    Pittsburgh
    Posts
    485
    Here's the idiom I've seen most often:

    Code:
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isd) = localtime(1112507217);
    where 1112507217 is your timestamp;

    -John.
    There's a reason army's wear uniforms even though it makes them easier to spot. Sometimes that's what you want. Uniforms suggest organization, power, and numbers. These, in turn, inspire fear. And, as any good operative knows, there is no more effective weapon than fear.

    Hosting Comparison - HostScope - jrrl.com

  3. #3
    Member
    Join Date
    January 18th, 2005
    Posts
    58
    thanks, for the reply

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Merchant Data file upload timestamp
    By leonusst in forum Rakuten LinkShare - LS
    Replies: 5
    Last Post: July 26th, 2007, 12:31 AM
  2. Dealing with timestamp in filename
    By jmrwv in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: September 8th, 2006, 07:39 AM
  3. Unix has a sense of humor...
    By James - AMWSO in forum Virtual Family and Off-Topic
    Replies: 1
    Last Post: December 6th, 2005, 08:41 AM
  4. Unix or Win 2000
    By jq in forum Domains & Hosting
    Replies: 9
    Last Post: December 19th, 2001, 05:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •