05-07-2015
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in
this forum under
special homework rules.
Please review the
rules, which you agreed to when you registered, if you have not already done so.
More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.
If you did post homework in the main forums, please review the
guidelines for posting homework and repost.
Thank You.
The UNIX and Linux Forums.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi, do shells in unix understand the language of perl?
learning perl will make u a ultimate shell programmer?
thanks (6 Replies)
Discussion started by: yls177
6 Replies
2. UNIX for Dummies Questions & Answers
Hey Guys i am new to Unix and i have downlaoded Cygwin for Windows and deleted it.
I was just wondering is there any good shells like that for windows that just as good
thanks for your time
][ce (1 Reply)
Discussion started by: IceCold
1 Replies
3. UNIX for Dummies Questions & Answers
Hi,
How to display date using echo command.
I tried "echo date" , it prints "date" not actual date
only date command prints actual date.
Thanks (4 Replies)
Discussion started by: avadhani
4 Replies
4. Shell Programming and Scripting
Solaris
Newbie here to scripting in UNIX/SOLARIS.
What I am looking to do is, once the script is
executed, switch to /bin/bash shell and continue
to execute the script.
The problem I run into is once the script switches to the Bash
shell, the script stops, and does not execute the... (2 Replies)
Discussion started by: Scoobiez
2 Replies
5. UNIX for Dummies Questions & Answers
How do I know what type of shells are available in my Unix system? Are there a single command or environment variable that can let me find that out?
Best regards,
John Chan (7 Replies)
Discussion started by: shuhang2
7 Replies
6. UNIX for Dummies Questions & Answers
hi. im new here. im taking a UNIX OS class and im in need of some help
how do i change my shell in UNIX?
for homework i need to edit the tcshrc file (to include aliases) in my home directory but its not there. so i think switching shells will create the file. am i correct?
I'm using PuTTy.... (1 Reply)
Discussion started by: alpha_centauri
1 Replies
7. Shell Programming and Scripting
Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7.
#!/bin/bash
dia () {
echo " Seleccione el dia:"
select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir
do... (6 Replies)
Discussion started by: iga3725
6 Replies
8. Shell Programming and Scripting
How do i echo the output of a unix command using shell script???
Like:
echo /etc/ ls -l (2 Replies)
Discussion started by: sunny2802
2 Replies
9. Programming
Can someone help by advising hw to built myself strong on logic building in UNIX shell scripting. I find it very difficult
Sent from my iPhone using Tapatalk (4 Replies)
Discussion started by: Vijaykannan T
4 Replies
10. UNIX for Beginners Questions & Answers
I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and
I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server
$ cat temp.txt
RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
LEARN ABOUT PHP
datetime.settimezone
DATETIME.SETTIMEZONE(3) 1 DATETIME.SETTIMEZONE(3)
DateTime::setTimezone - Sets the time zone for the DateTime object
Object oriented style
SYNOPSIS
public DateTime DateTime::setTimezone (DateTimeZone $timezone)
DESCRIPTION
Procedural style
DateTime date_timezone_set (DateTime $object, DateTimeZone $timezone)
Sets a new timezone for a DateTime object.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $timezone
- A DateTimeZone object representing the desired time zone.
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.setTimeZone(3) example
Object oriented style
<?php
$date = new DateTime('2000-01-01', new DateTimeZone('Pacific/Nauru'));
echo $date->format('Y-m-d H:i:sP') . "
";
$date->setTimezone(new DateTimeZone('Pacific/Chatham'));
echo $date->format('Y-m-d H:i:sP') . "
";
?>
Procedural style
<?php
$date = date_create('2000-01-01', timezone_open('Pacific/Nauru'));
echo date_format($date, 'Y-m-d H:i:sP') . "
";
date_timezone_set($date, timezone_open('Pacific/Chatham'));
echo date_format($date, 'Y-m-d H:i:sP') . "
";
?>
The above examples will output:
2000-01-01 00:00:00+12:00
2000-01-01 01:45:00+13:45
SEE ALSO
DateTime.getTimezone(3), DateTimeZone.__construct(3).
PHP Documentation Group DATETIME.SETTIMEZONE(3)