Solaris 10 doesn't seem to like me a lot. I am trying to run a simple script to accept date and return epoch of that date:
#!/usr/bin/perl -w
use strict;
use Time::ParseDate;
my($date1)="Mon Mar 27 05:54:08 CDT 2009";
chomp $date1;
#Convert to seconds since start of epoch
my $time1 =... (3 Replies)
Hi all!
I have a "simple" problem:
I want to convert a date and time string (YYYYMMDDhhmmss) to epoch (unix time) in a shellscript.
I want to use the "date/time" string as an input to the script, eg:
scriptname.sh 20090918231000 and get the epoch format echoed out.
Is there an... (3 Replies)
System: HP-UX
Kornshell
Perl is installed, but not POSIX
Hello,
I am calculating a future date/time. To do this I take the system date in epoch format and add to it. I now need to take the new epoch date and convert it to MMDDYYHHmm format.
Any help with this is greatly appreciated. (4 Replies)
Could someone please explain how to get a formatted date from the unix epoch (the number of seconds since Jan 1, 1970)
For example.,
If the input is 1297969816, then the output should be 2011-02-17 in YYYY-MM-DD formatted manner.
I am using AIX sh shell. Tried date -d and date --date, these... (4 Replies)
I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates.
Example :
date -d "2007-09-01 17:30:40" '+%s'
But this gives me below error
date: illegal option -- d
Usage: date
OS: AIX... (6 Replies)
Hi all ,
I need to know how to convert a time stamp entered by the user to be converted to GMT/UTC(epoch time) using mktime() and gmtime()
for exapample the input will be put in the form
ptm.tm_sec = 0;
ptm.tm_min = 59;
ptm.tm_hour = 11;
ptm.tm_mday = 20;... (2 Replies)
Hi all,
In terminal when I enter:
date -j -f date -j -f "%Y/%m/%d %T" "2011/09/30 13:00:00" +"%s"
The output is:
When I put 2011/09/30 in var A, and I subsequently enter:
date -j -f date -j -f "%Y/%m/%d %T" "${A} 13:00:00" +"%s"
The output is: (10 Replies)
so i have to perform a certain task at set times. for instance, i need to run a job at 12:30am every night, and other jobs, i only need to have them run on saturdays.
how do i manipulate the date command to give me the epoch equivalence of what 12:30am would be every day?
im looking for a... (3 Replies)
I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date
#!/usr/bin/ksh
set -x
for s in server ; do
ssh -T $s <<-EOF
from_date="12-Jan-2015 12:02:09"
to_date="24-Jan-2015 13:02:09"
echo \$from_date
echo... (7 Replies)
Discussion started by: raj48
7 Replies
LEARN ABOUT HPUX
set_directory_epoch
set directory to new epoch(1m) set directory to new epoch(1m)NAME
set directory to new epoch - Reconstructs a directory's replica set, allowing you to designate a new master replica or to exclude a replica
SYNOPSIS
cdscp set directory directory-name to new epoch master clearinghouse-name [readonly clearinghouse-name...] [exclude clearinghouse-name...]
ARGUMENTS
The full name of the directory. The full name of the clearinghouse in which an individual replica is located. The first clearinghouse-
name specifies where the master replica is stored.
DESCRIPTION
The set directory to new epoch command reconstructs a directory's replica set, allowing you to designate a new master replica or to exclude
a replica. You must list each existing replica and indicate whether an existing replica needs to be included in or excluded from the new
replica set. You can include or exclude more than one replica. The ellipses (...) indicates that you can specify multiple clearinghouse
names, separated by spaces.
When you set a new epoch on a directory, you must disable the clearinghouse containing the replica that is being excluded. To do this, use
the disable server command (if the server has more than one clearinghouse, all its clearinghouses will be disabled). Note that all clear-
inghouses that are not excluded must be enabled and available before you issue the disable server command.
Privilege Required
You must have administer permission to the directory, and the server principal needs administer, read, and write permission to the direc-
tory. When designating a new master replica, you also need write permission to the clearinghouse that stores the new master replica, and
the server principal needs write permission to each clearinghouse where the replica type is changed to read-only.
NOTE
This command may be replaced in future releases by the dcecp command, and may no longer be supported at that time.
EXAMPLE
The following command sets a new epoch for the directory /.:/mfg. The master replica is in the clearinghouse /.:/Paris1_CH, and read-only
replicas are in the clearinghouses /.:/Chicago1_CH, /.:/Seattle_CH, and /.:/NY1_CH. The new replica set excludes the replica in the clear-
inghouse /.:/NY1_CH. cdscp> set directory /.:/mfg to new epoch master /.:/Paris1_CH > readonly /.:/Chicago1_CH /.:/Seattle_CH exclude
/.:/NY1_CH
RELATED INFORMATION
Commands: set directory to skulk(1m), show directory(1m), show replica(1m)
set directory to new epoch(1m)