02-17-2006
date query
Yes..I had in fact lokked into the date calc script which is immensely useful for such calculations...but the problem is that that would entail an extra shell script in the package that is to be handed over to our clients and that i have been told to avoid ...If anyone comes across any single line command that would do the trick, kindly let me know............
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there
I am using the following command to get today's date:
Date=`date '+%Y%m%d'`
This has the format 20040409
What I want is today's date -1 i.e. get yesterdays date.
What is the command for this?
Thanks :) (1 Reply)
Discussion started by: niamh
1 Replies
2. UNIX for Dummies Questions & Answers
IS there a way to use the unix date command to find the 2nd Saturday fo every month?
Each Month I want to execute a specific command only of the 2nd Saturday. (1 Reply)
Discussion started by: redsoxfan
1 Replies
3. UNIX for Dummies Questions & Answers
I have a problem... it's possible execute a command DATE with the sintax of LINUX system ???
Example: in Linux i can execute the command line : date -- set "10 minutes" and i have a output the date with the actual date - 10 min.
It's possible have the same rusult in the Unix system ?????
... (3 Replies)
Discussion started by: ZINGARO
3 Replies
4. Shell Programming and Scripting
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies
5. Programming
hello
please I need code command date in c
I have a projet in my unv
I am waiting your enswer:b::b:
sorry on my english (1 Reply)
Discussion started by: mahfode
1 Replies
6. Shell Programming and Scripting
I'm on hp-unix. I would like a variable to hold the last change date of a file. I looked at the man pages for stat, but I don't see any examples and can't get the syntax right. Can anyone help me? Thank you. (2 Replies)
Discussion started by: sboxtops
2 Replies
7. Shell Programming and Scripting
I need to use a shell script, using sed command how to replace date variable value in following format.
04/18/2012 11:38:55
Because the sed is treating the '/' as a parameter instead of the value of a variable, and hence there is the message as
sed: command garbled: s/insert/04/18/2012... (9 Replies)
Discussion started by: jannusuresh
9 Replies
8. Shell Programming and Scripting
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies
9. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 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_parse_from_format
DATE_PARSE_FROM_FORMAT(3) 1 DATE_PARSE_FROM_FORMAT(3)
date_parse_from_format - Get info about given date formatted according to the specified format
SYNOPSIS
array date_parse_from_format (string $format, string $date)
DESCRIPTION
Returns associative array with detailed info about given date.
PARAMETERS
o $format
- Format accepted by DateTime.createFromFormat(3).
o $date
- String representing the date.
RETURN VALUES
Returns associative array with detailed info about given date.
EXAMPLES
Example #1
date_parse_from_format(3) example
<?php
$date = "6.1.2009 13:00+01:00";
print_r(date_parse_from_format("j.n.Y H:iP", $date));
?>
The above example will output:
Array
(
[year] => 2009
[month] => 1
[day] => 6
[hour] => 13
[minute] => 0
[second] => 0
[fraction] =>
[warning_count] => 0
[warnings] => Array
(
)
[error_count] => 0
[errors] => Array
(
)
[is_localtime] => 1
[zone_type] => 1
[zone] => -60
[is_dst] =>
)
SEE ALSO
DateTime.createFromFormat(3), checkdate(3).
PHP Documentation Group DATE_PARSE_FROM_FORMAT(3)