How are you calling the date.sh script from the other scripts? Can you please post that. I tried the following and it worked:
The following is the date.sh script. Please note that there is no export command in this:
The following is prog1.sh where I want to use the begin_date variable. I have sourced the date.sh script in the prog1.sh script:
Now when I execute prog1.sh as follows:
Just for clarification, the leading "." in line no 3 in prog1.sh is for sourcing a script within another script, and the ./date.sh is to specify that the date.sh is in the current directory (the same directory where the prog1.sh is located), if you have placed the date.sh in some other location such as /home/user01/comm_scripts, you can replace the ./ with the full path of the script.
Can I determine when the particular file was created, in korn-shell. Can please someone help me. If possible please mail the solution to me.
my mail id: bharat.surana@gmail.com (1 Reply)
Hiee .... i want an immediate solution for this....
Let replace.cfg file contains a list of files to be replaced the old dates with new dates......
The script must take 3 parameters....
1) old date
2) new date
3) .config file
Can u get me the solution......
I tried with sed but i... (2 Replies)
Hi Guys,
My requirement is I have file called /opt/orahome/.profile in non global zone.
PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:.
export PATH
PS1="\${ORACLE_SID}:`hostname`:\$PWD$ "
export PS1
EDITOR=vi
export EDITOR
ENV=/opt/orahome/.kshrc
export ENV... (1 Reply)
Hello,
I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
I am looking to do something where if I created a file named backup,or whatever it would print a name like “backup_Apr_11_2011”. Thanks citizencro (1 Reply)
Hello,
I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Hi,
Have assigned values in Array and iterating in while loop and would require values outside of the loop. But its returning NULL.
could you please help us how to define Global array declaration in Unix shell scripting?
i am using Kron shell.
Thanks in advance. (2 Replies)
Hi,
I have a file which has a date extension to it.
Like <filename>_01012014.
I need to rename the file as 12152013 , that is i need to be able to subtract 15 days from the date of the file name.
Please advise how this can be handled using shell scripting.
Regards,
VN (8 Replies)
hi all,
Just a simple question but i cant get the answers in the book -
In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone
Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in... (6 Replies)
Hi,
If I change date and time in global zone, then it will affect in non global zones.
During this process what files will get affect in non global zones and which mechanism it's using to change.
gloabl zone:Solaris 11.3 X86
TIA (1 Reply)
Discussion started by: Sumanthsv
1 Replies
LEARN ABOUT PHP
datetime.setdate
DATETIME.SETDATE(3) 1 DATETIME.SETDATE(3)DateTime::setDate - Sets the date
Object oriented style
SYNOPSIS
public DateTime DateTime::setDate (int $year, int $month, int $day)
DESCRIPTION
Procedural style
DateTime date_date_set (DateTime $object, int $year, int $month, int $day)
Resets the current date of the DateTime object to a different date.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $year
- Year of the date.
o $month
- Month of the date.
o $day
- Day of the date.
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | Changed the return value on success from NULL to |
| | DateTime. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
DateTime.setDate(3) example
Object oriented style
<?php
$date = new DateTime();
$date->setDate(2001, 2, 3);
echo $date->format('Y-m-d');
?>
Procedural style
<?php
$date = date_create();
date_date_set($date, 2001, 2, 3);
echo date_format($date, 'Y-m-d');
?>
The above examples will output:
2001-02-03
Example #2
Values exceeding ranges are added to their parent values
<?php
$date = new DateTime();
$date->setDate(2001, 2, 28);
echo $date->format('Y-m-d') . "
";
$date->setDate(2001, 2, 29);
echo $date->format('Y-m-d') . "
";
$date->setDate(2001, 14, 3);
echo $date->format('Y-m-d') . "
";
?>
The above example will output:
2001-02-28
2001-03-01
2002-02-03
SEE ALSO DateTime.setISODate(3), DateTime.setTime(3).
PHP Documentation Group DATETIME.SETDATE(3)