Operating System - HP-UX
1752753 Members
4672 Online
108789 Solutions
New Discussion

userdbget auth_ftime - how to convert to a proper date/time ?

 
Md_Shaahbuddin
Occasional Contributor

userdbget auth_ftime - how to convert to a proper date/time ?

Hi everyone,

 

on my HPUX 11.31 box userdbget shows this;

 

> userdbget -i -u test
test auth_ftime=0x4f27c175

The auth failure time is in hex. But converting to decimal doesnt reveal the date+time. Man on userdbget doesnt show how to convert to a real date+time either. Nothing on docs.hp.com about it either.

 

Anyone know how to convert it to a proper date+time please ?

 

Thanks

 

4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: userdbget auth_ftime - how to convert to a proper date/time ?

That is the epoch time denoted in hex.

 

hex 4f27c175 = decimal 1328005493

 

So now converting the epoch seconds to a calendar date yields:

Tue, 31 Jan 2012 10:24:53 GMT

 

I used the epoch time converter at:

http://www.epochconverter.com/

 

There are ways to convert from the command line as well.  A search of the Forums or Google should yield results.

Md_Shaahbuddin
Occasional Contributor

Re: userdbget auth_ftime - how to convert to a proper date/time ?

thanks!

Patrick Wallek
Honored Contributor

Re: userdbget auth_ftime - how to convert to a proper date/time ?

From the command line:

 

Hex to decimal conversion -- Note that the hex number has to have the letters in uppercase.

# echo "ibase=16; 4F27C175"|bc

1328005493

To convert to regular date time (requires PERL):

# perl -e "print scalar(localtime(1328005493))"
Tue Jan 31 04:24:53 2012

Dennis Handly
Acclaimed Contributor

Re: userdbget auth_ftime - how to convert to a proper date/time?

You can also use adb:

echo "0x4f27c175 =Y" | TZ=GMT0 adb -o -  # you can leave out TZ if you want local time

   2012 Jan 31 10:24:53

 

>From the command line:

 

You can use: typeset -i10 x=16#4f27c175; echo $x  # convert to base 10

 

>perl -e "print scalar(localtime(1328005493))"

 

perl will also take that hex number directly.