Veritas-bu

[Veritas-bu] Convert "English Time" back to "seconds past the epoch"

2005-02-02 09:09:47
Subject: [Veritas-bu] Convert "English Time" back to "seconds past the epoch"
From: ewilts AT ewilts DOT org (Ed Wilts)
Date: Wed, 2 Feb 2005 08:09:47 -0600
On Wed, Feb 02, 2005 at 01:15:39PM +0200, Marianne van den Berg wrote:
> I desperately need help - I need to use the following output to
> populate and assign media manually to volDB:
 
> 000408  HCART     NONE     -      -     -     ---           -         109     
> 11/11/2004 00:10     ---      ---   Scratch   

> I can do a 'vmadd' based on the above output, but I also need to
> assign the media, using fields 12 and 13 (e.g. 01/24/2005 19:06). The
> problem is that "vmquery -assignbyid" needs 'assigntime' in 10-digit
> format. How can I convert the date and time?  (Testing on Solaris,
> need to do this on Linux.)
 
On Linux (both RHEL 3 and Fedora Core 3):
$ date -d '11/11/2004 00:10' +%s
1100153400

The %s is a GNU extension so it might not be there on Solaris.

-- 
Ed Wilts, Mounds View, MN, USA
mailto:ewilts AT ewilts DOT org