07-26-2006
Date stamp:
format:
#!/bin/ksh
DAY=`date +%y%m%d`
When you echo $DAY, the output is 060726
When you want to add a TIMESONE to your DAY stamp, you will need to do the following:
first, on command line type the command "date"...This will show you your time zone
In you DAY string, change it to the following:
DAY=`TZ=GMT date +%y%m%d`
Now you can start playing around with the DAY parameter...You can go ahead a day or two, or backwards....
example:
DAY=`TZ=GMT+24 date +%y%m%d`
Output:
060725
The + will take you back....If you specify a -, it will take you forward...
Regards
Henk
9 More Discussions You Might Find Interesting
1. IP Networking
How can UNIX systems obtain IP addresses? Can it obtain from Win 2000 Server, DHCP service, dynamically? (1 Reply)
Discussion started by: Raael
1 Replies
2. UNIX for Advanced & Expert Users
Is there any way I can get UNIX to return the Process ID of a process when I actually issue the command to invoke the process?
For example, if I was to launch an emacs process in batch mode, by issuing the UNIX command :
% emacs file.txt&
then UNIX would return the Process ID (PID).... (7 Replies)
Discussion started by: 1cuervo
7 Replies
3. Programming
I have written a program to collect some performance metrics on and AIX box, but I'm having difficultly getting the process information.
I'm lead to believe that I'm not getting the correct information because I'm trying to run the program on AIX 5.1 (5100-03), but I'm not convinced as the... (0 Replies)
Discussion started by: StuBob
0 Replies
4. What is on Your Mind?
I'm looking to move down to the Baltimore, MD area and have been looking for a job for about a week. Many of the opportunities require some form of security clearance, because many of the jobs are government work.
My question is how do I go about obtaining the proper clearance? I'm a U.S.... (6 Replies)
Discussion started by: dangral
6 Replies
5. Shell Programming and Scripting
Hi ,
I am relatively new to unix...
Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell..
This is very urgent.
Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
6. IP Networking
HI folks,
I am developing a software which one of the module is to interchange the ip address of another active network interface's when making a socket connection.
I would like to know whether there is any function call that would enable me to retrieve the ip address that is obtained by a... (2 Replies)
Discussion started by: citiz3n
2 Replies
7. Shell Programming and Scripting
Hi All,
I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this.
My Requirment is as below:
Input for me will be 2000909(YYYYMM)
I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies
8. Shell Programming and Scripting
Hi all,
is there a way using GNU (Solaris 8) methods of obtaining the day before a given day?
i.e. 2007-09-09.... I would like the date a day before it so output would be 2007-09-08. Format YYYY-MM-DD
I know I can subtract the day number using cut and expr but it would get tricky if the... (3 Replies)
Discussion started by: muay_tb
3 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day.
i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies
LEARN ABOUT PHP
cal_from_jd
CAL_FROM_JD(3) 1 CAL_FROM_JD(3)
cal_from_jd - Converts from Julian Day Count to a supported calendar
SYNOPSIS
array cal_from_jd (int $jd, int $calendar)
DESCRIPTION
cal_from_jd(3) converts the Julian day given in $jd into a date of the specified $calendar. Supported $calendar values are CAL_GREGORIAN,
CAL_JULIAN, CAL_JEWISH and CAL_FRENCH.
PARAMETERS
o $jd
- Julian day as integer
o $calendar
- Calendar to convert to
RETURN VALUES
Returns an array containing calendar information like month, day, year, day of week, abbreviated and full names of weekday and month and
the date in string form "month/day/year".
EXAMPLES
Example #1
cal_from_jd(3) example
<?php
$today = unixtojd(mktime(0, 0, 0, 8, 16, 2003));
print_r(cal_from_jd($today, CAL_GREGORIAN));
?>
The above example will output:
Array
(
[date] => 8/16/2003
[month] => 8
[day] => 16
[year] => 2003
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Aug
[monthname] => August
)
SEE ALSO
cal_to_jd(3), jdtofrench(3), jdtogregorian(3), jdtojewish(3), jdtojulian(3), jdtounix(3).
PHP Documentation Group CAL_FROM_JD(3)