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
date_default_timezone_get
DATE_DEFAULT_TIMEZONE_GET(3) 1 DATE_DEFAULT_TIMEZONE_GET(3)
date_default_timezone_get - Gets the default timezone used by all date/time functions in a script
SYNOPSIS
string date_default_timezone_get (void )
DESCRIPTION
In order of preference, this function returns the default timezone by:
o Reading the timezone set using the date_default_timezone_set(3) function (if any)
o Prior to PHP 5.4.0
only: Reading the $TZ environment variable (if non empty)
o Reading the value of the date.timezone ini option (if set)
o Prior to PHP 5.4.0
only: Querying the host operating system (if supported and allowed by the OS). This uses an algorithm that has to guess the time-
zone. This is by no means going to work correctly for every situation. A warning is shown when this stage is reached. Do not rely
on it to be guessed correctly, and set date.timezone to the correct timezone instead.
If none of the above succeed, date_default_timezone_get will return a default timezone of UTC.
RETURN VALUES
Returns a string.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.4.0 | |
| | |
| | The TZ environment variable is no longer used to |
| | guess the timezone. |
| | |
| 5.4.0 | |
| | |
| | The timezone is no longer guessed from informa- |
| | tion available through the operating system as |
| | the guessed timezone can not be relied on. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Getting the default timezone
<?php
date_default_timezone_set('Europe/London');
if (date_default_timezone_get()) {
echo 'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';
}
if (ini_get('date.timezone')) {
echo 'date.timezone: ' . ini_get('date.timezone');
}
?>
The above example will output something similar to:
date_default_timezone_set: Europe/London
date.timezone: Europe/London
Example #2
Getting the abbreviation of a timezone
<?php
date_default_timezone_set('America/Los_Angeles');
echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('T');
?>
The above example will output:
America/Los_Angeles => America/Los_Angeles => PST
SEE ALSO
date_default_timezone_set(3), "List of Supported Timezones".
PHP Documentation Group DATE_DEFAULT_TIMEZONE_GET(3)