04-12-2002
The command "date -u" will switch to GMT.
For a more complete list of the format characters that you can use with the date command, type "man strftime".
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everybody
I have a problem with a shell. It runs every night just once a night on my sun system.
#!/bin/ksh
export pfad_work=/usr/users/ftp/testdaten
export pfad_daten=/u01/projects/iris_unix/inp_test_daten/data
export pfad_term=/u01/projects/iris_unix/inp_test_term/data
cd... (2 Replies)
Discussion started by: Peterh
2 Replies
2. Shell Programming and Scripting
Hi there I currently use a line in a script
ndate=$(date +"%d/%m/%Y")
This obviously returns the date in a format i have chosen. However, I need to come up with a solution for weekends and as such need a way of returning todays date minus two days in the same format (24/11/2004)
so for... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
3. Shell Programming and Scripting
Hai,
i need the date should be older than 30 days
input
14-02-2006
output
15-01-2006
Please help me (1 Reply)
Discussion started by: readycpbala
1 Replies
4. Shell Programming and Scripting
i have a process
----------------------------------------------------------------------
pipe 1044528 1278036 4 Dec 07 - 58:23 java -Xms128m -Xmx1024m -D_AppName=DBMaint com.eMeter.dbmaint.DBMaintAdapter /home/pipe/conf/appProperties/DBMaint.properties
root 1073166 1134628 0 Feb... (2 Replies)
Discussion started by: ali560045
2 Replies
5. Shell Programming and Scripting
i have a script that grep for today date
a=`date +"%F"`--------greps current/today date
wat if suppose i want to grep a date for yesterday...
how to do that using the above format: i,e 2008-01-20 (4 Replies)
Discussion started by: ali560045
4 Replies
6. AIX
hi friends
I am using AIX 5.2 version
when ever i try to use
echo $(date -d yesterday +"%Y%m%d")
I am getting error as
date: not recognized flag d
please help me solve this.
I wanted to find the next date from a given date.
I tried using diff script but all of them failed at some... (5 Replies)
Discussion started by: sameerspice
5 Replies
7. Shell Programming and Scripting
Hi Guys,
I have a file a.txt
Start Date/Time End Date/Time from Prob_Dura.
----------------- ----------------- ----- ------
20090525 23:58:59 20090526 00:00:00 machine1 000051
20090525 23:58:09 20090526 00:00:11 machine2 000150
The perl or shell script can:
1. remove... (4 Replies)
Discussion started by: jimmy_y
4 Replies
8. Shell Programming and Scripting
Hi ,
I need a function that verfies the given date is between start date and end date .
I have written this but this not working if start date is 1900/01/01
Below is my code
validateDate()
{
RC=$#
if
then
return 0
else
... (2 Replies)
Discussion started by: Satyak
2 Replies
9. Shell Programming and Scripting
hi everyone
i have another date problem
i need to find out the last week number and in that last week i need to find out at what day monday comes.
please help (5 Replies)
Discussion started by: aishsimplesweet
5 Replies
10. Shell Programming and Scripting
I have written a code in Linux environment which compares two dates and print "correct" if 1st date is less than 2nd date. But when I'm running the same code in SunOS environment, "date -d is an illegal format" is the error it is throwing. How different should my code be so that it executes well in... (18 Replies)
Discussion started by: Chandan_Bose
18 Replies
GMDATE(3) 1 GMDATE(3)
gmdate - Format a GMT/UTC date/time
SYNOPSIS
string gmdate (string $format, [int $timestamp = time()])
DESCRIPTION
Identical to the date(3) function except that the time returned is Greenwich Mean Time (GMT).
PARAMETERS
o $format
- The format of the outputted date string. See the formatting options for the date(3) function.
o $timestamp
- The optional $timestamp parameter is an integer Unix timestamp that defaults to the current local time if a $timestamp is not
given. In other words, it defaults to the value of time(3).
RETURN VALUES
Returns a formatted date string. If a non-numeric value is used for $timestamp, FALSE is returned and an E_WARNING level error is emitted.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | The valid range of a timestamp is typically from |
| | Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 |
| | 03:14:07 GMT. (These are the dates that corre- |
| | spond to the minimum and maximum values for a |
| | 32-bit signed integer). However, before PHP 5.1.0 |
| | this range was limited from 01-01-1970 to |
| | 19-01-2038 on some systems (e.g. Windows). |
| | |
| 5.1.1 | |
| | |
| | There are useful constants of standard date/time |
| | formats that can be used to specify the $format |
| | parameter. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
gmdate(3) example
When run in Finland (GMT +0200), the first line below prints "Jan 01 1998 00:00:00", while the second prints "Dec 31 1997
22:00:00".
<?php
echo date("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998));
echo gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998));
?>
SEE ALSO
date(3), mktime(3), gmmktime(3), strftime(3).
PHP Documentation Group GMDATE(3)