02-14-2012
@chihung: thanks much for your reply. I havent tried running a python script, how do i execute a python script?many thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am writing some PERL code (and I realize this is a UNIX forum), but was wondering if anyone has a quick routine (PERL or shell scripting) to take a date in YYYYMMDD format and return the 3 digit Julian number.
For instance, my program will have a variable called "$Settlement_Date" and will... (5 Replies)
Discussion started by: dfran1972
5 Replies
2. Shell Programming and Scripting
How to convert the date field from dd/mm/yyyy to yyyy/mm/dd in unix
my script will generate text file which have two fields
one is date and another is name of the server for example this is sample date which I have to sort based on older to newer date the problem is when I found out sort will... (4 Replies)
Discussion started by: pareshan
4 Replies
3. Shell Programming and Scripting
Can't find out how to get the day of the week from a given date, anyone got a code snippet that could help please?
Ta!! (4 Replies)
Discussion started by: couponmeup
4 Replies
4. Shell Programming and Scripting
Hi guys,
I know if I try to get a julian date using a specific date I can but I try to get the current date I got an error as you can see below:
This one works fine:
date -d "2010/10/30" +%j
But I can't get the current date as below:
`date -d "+%Y/%m/%d`" +%j
Does somebody can... (6 Replies)
Discussion started by: edudiogo
6 Replies
5. Shell Programming and Scripting
Hello,
I am writing a script that parses different logs and produces one. In the source files, the date is in DD MM YYYY HH24:MI:SS format. In the output, it should be in DD MON YYY HH24:MI:SS (ie 25 Jan 2010 16:10:10)
To extract the dates, I am using shell substrings, i.e.:
read line
... (4 Replies)
Discussion started by: Adamm
4 Replies
6. Shell Programming and Scripting
Hi , I need to convert date from YYYYMMDD to DD-MON-YYYY
e.g
20111214 to 14-Dec-2011
Please help. (17 Replies)
Discussion started by: ady_koolz
17 Replies
7. Shell Programming and Scripting
Hi,
How can I convert day of year value in format(yy,doy) to normal formatted (dd.mm.yyyy) string also all of them with awk or awk system function?
in_file.txt
---------
12,043
12,044
12,045
12,046
out_file.txt
----------
12.02.2012
13.02.2012
14.02.2012
15.02.2012
imagine... (5 Replies)
Discussion started by: kocaturk
5 Replies
8. Shell Programming and Scripting
Hello All,
I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B.
Note that my data has some other columns(not shown here) too (around 100) after col2.
Tool,Data
A,1
A,3
A,5
....
so on
B,2
B,4
.... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies
9. Shell Programming and Scripting
hello,
I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc.
I need to do it for several years and leap years as well.
What is the best way to do it ?
Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies
10. Shell Programming and Scripting
Hi,
I have a requirement where I have to pass Date to a script and get the day from it.
Ex If parameter is 2015-09-29
The output should be Tuesday.
Can you please tell me how to get that? (6 Replies)
Discussion started by: ashwin3086
6 Replies
LEARN ABOUT HPUX
dtsearchvaliddatestring
DtSearchValidDateString(library call) DtSearchValidDateString(library call)
NAME
DtSearchValidDateString -- Validate and convert a user date string
SYNOPSIS
#include <Dt/Search.h>
DtSrObjdate DtSearchValidDateString(
char *date_string);
DESCRIPTION
DtSearchValidDateString validates a DtSearch date string, as might have been entered by a user in a free form text field, and converts it
into a valid DtSrObjdate.
Since an invalid date string format returns a distinctive DtSrObjdate, this function may also be used as a boolean test for string valid-
ity.
ARGUMENTS
date_string
Specifies the date string to be validated and converted.
The format for a valid date string is "[yyyy [mm [dd]]", one, two, or three ASCII numeric tokens separated by one or more nonnu-
meric chars (whitespace, slashes, etc). The integer yyyy represents a Gregorian calendar year number in the range 1990 to 5995
inclusive. If yyyy is less than 1900, 1900 is added to it. The integer mm is a Gregorian calendar month number in the range 1 to
12 inclusive. The integer dd is a Gregorian calendar day number in the range 1 to 31 inclusive.
If only two tokens are in the string, they are presumed to be yyyy and mm, and dd is presumed to be to 1.
If only one token is in the string, it is presumed to be yyyy, and both mm and dd are presumed to be 1.
RETURN VALUE
DtSearchValidDateString returns zero (a valid DtSrObjdate) if date_string is NULL or empty.
It returns a correctly formatted DtSrObjdate on successful parse and conversion.
It returns -1 and a message on the MessageList if date_string is invalid.
SEE ALSO
DtSrAPI(3), DtSearchQuery(3), dtsrfzkfiles(4), DtSearch(5)
DtSearchValidDateString(library call)