Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

a simple way of converting a date in seconds to normal date

HP-UX


Tags
perl, perl shift, shift, shift perl

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-22-2006
travian travian is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 10 January 2007, 10:36 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
a simple way of converting a date in seconds to normal date

Hi all!

I'm working on a HPUX system, and I was wondering if there is a simple way to convert a date from seconds (since 1970) to a normal date.

Thanks
Sponsored Links
    #2  
Old Unix and Linux 11-22-2006
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Advisor  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 469 Times in 270 Posts
Pretty easy with perl:
$ perl -e 'print scalar localtime(shift),"\n"' 1164876000
Thu Nov 30 03:40:00 2006

Even if you have not installed a recent version of perl, HP-UX should have an old version in /usr/contrib/bin that is good enough for this.
Sponsored Links
    #3  
Old Unix and Linux 11-23-2006
travian travian is offline
Registered User
 
Join Date: Nov 2006
Last Activity: 10 January 2007, 10:36 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks!

It works just fine Linux
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Date format in micro seconds srichunduru Shell Programming and Scripting 2 02-02-2012 06:45 AM
Converting past date to seconds synergy_texas Shell Programming and Scripting 3 03-30-2009 07:02 PM
how to get the milli seconds from date in sun unix r2b Shell Programming and Scripting 1 03-28-2005 04:26 PM
how to get the milli seconds from date in sun unix r2b Solaris 2 03-28-2005 04:15 PM
Translate date value to normal date and backwards. Frederik UNIX for Advanced & Expert Users 4 12-10-2003 02:44 AM



All times are GMT -4. The time now is 03:57 AM.