04-04-2005
How to manipulate date?
Hi
can u pls help me out with this as
i am relatively new to unix.
I need to use 4 different types of dates in my shell script
* first day of the last(previous) month
* last day of the last(previous) month
* first day of the current month
* (sysdate-1) yesterday's date for the current month.
in dd/mm/yyyy HH24:MI:SS format..
I need to use them in my shell script
I need to pass the above date variables to a sql script..
thnks in advance..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In an operation, I have output like 22562K I want to manipulate this and want to perform some mathematical operations on that, any idea how can I get the digit no? (2 Replies)
Discussion started by: csaha
2 Replies
2. Shell Programming and Scripting
Hi everybody:
I have a problem. I have a output files which have this pattern:
number1
--space
block1a - 7rows/10columns/65elements
--space
block1b - 7rows/10columns/65elements
--space
block1c - 7rows/10columns/65elements
--space
number2
--space
block2a - 7rows/10columns/65elements... (0 Replies)
Discussion started by: tonet
0 Replies
3. Shell Programming and Scripting
dear all,
on solaris10 for x86 i am trying to modify the creation date of a postscript file with sed in a csh script. sed is driving me crazy though...i think due to the spaces in the string i am trying to substitute??
part of the postscript file:
%!PS-Adobe-3.0... (3 Replies)
Discussion started by: lada niva
3 Replies
4. Shell Programming and Scripting
Hi
as output i get a directory (i don't know its name) with many files inside.
Now i need to find the directory name and change it as i need.
I can found a directory name with this command:
find -maxdepth 1 -type d | grep out
Now i'd like to assign it to a variable and change it. ... (4 Replies)
Discussion started by: Dedalus
4 Replies
5. AIX
Hi,
I need to convert the below string in 'yyyymmdd' format.
e.g.,
24 June 2011 -> 20110624
Please help !! (4 Replies)
Discussion started by: ruby
4 Replies
6. Solaris
I have script where in i issue a command to get back 6 month earlier date.
below command works on all linux distribution.
# date +%Y-%m-%d --date="2012-03-31 - 183 days ago"
2011-09-30
Is there any solaris equivalent command to do the same? (1 Reply)
Discussion started by: pinga123
1 Replies
7. Shell Programming and Scripting
Hi Guys,
I have a file that lists patches along with other information.
The patches are listed in two different formats.
One format lists the latest patch, date , installed patch
Latest Patch Date IN
148412-02 13-Sep-2012 -- X X SunOS 5.10: nss_dns patch
126206-10 ... (5 Replies)
Discussion started by: Tornado
5 Replies
8. Shell Programming and Scripting
Hi
i want to manipulate my data to convert row to column
name
600
Slno vlan
1 600
2 609
3 700
name
700
Slno vlan
1 600
2 609
3 700 (8 Replies)
Discussion started by: nith_anandan
8 Replies
9. Shell Programming and Scripting
Hello,
How do i manipulate .csv file to this format?
Thank you very much.
Source:
john,5
marco,7
john,4
paul,3
marco,8
Output:
john,9
marco,15 (5 Replies)
Discussion started by: tara123
5 Replies
10. Shell Programming and Scripting
Good morning everyone,
I'm currently trying to convert an environment variable into a string and then attach it at the end of a command and launch it.
I have the following right now, but it's very ugly:
AMI_TAGS="env=test,country=XX,city=blah,galaxy=blahblah"
aws ec2 create-tags... (8 Replies)
Discussion started by: da1
8 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)