Sponsored Content
Top Forums Shell Programming and Scripting Converting YYYYMMDD to Julian Post 70329 by dfran1972 on Wednesday 27th of April 2005 02:34:43 PM
Old 04-27-2005
Converting YYYYMMDD to Julian

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 contain a value like this: "20050422", and I would like it to return a new variable with the value "112".

Any help or insight would be appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Julian Date

I have a shell script which gets passed a parameter which is a combination of Year and Julian Date <YYYYj>. So April 11th, julian date is 101. So if I wanted April 11th for 2003 I would get the following value 2003101. How would I convert that in unix to be 20030411? I am using the korn shell. (3 Replies)
Discussion started by: lesstjm
3 Replies

2. Shell Programming and Scripting

Julian Dates and the Cal command

hey all, I was wondering if it was possible to get the julian date with the cal command. I know that the "-j" option will display it, however, i need the Julian Date of a specific date, in number. For example, the User would enter their age like 19800101 or YYYMMDD, like so. This info... (0 Replies)
Discussion started by: shan2on
0 Replies

3. UNIX for Dummies Questions & Answers

How to get yesterdays julian date

Hi, Was using date +%Y%j to get current julian date. Can anyone let me know how can I get y'day's julin date. Thx Did check FAQ but couldn't find anything. Thanks. (3 Replies)
Discussion started by: er_ashu
3 Replies

4. Shell Programming and Scripting

need help using find and date (julian)

I'm trying to put together a little script that will move some files to a directory, uncompress the file then delete the file when processing is complete. The files are all named using julian date 2009072.Z 2009071.Z 2009070.Z 2009069.Z 2009068.Z 2009067.Z 2009066.Z 2009065.Z... (8 Replies)
Discussion started by: 1buckeye_fan
8 Replies

5. Homework & Coursework Questions

How to approach Julian date?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This function is given the day, month and year and returns the Julian date. The Julian date is the... (1 Reply)
Discussion started by: mgyeah
1 Replies

6. Shell Programming and Scripting

What do this Julian Date Syntax explains about?

I want to know, what exactly this Julian Date Function is all about? #!/usr/bin/ksh #Script That notify the User Expiration in Servers function juliandate { day=$1 month=$2 year=$3 ((standard_jd = day - 32075 + 1461 * (year + 4800 - (14 - month)/12)/4 + 367 * (month -... (3 Replies)
Discussion started by: baraghun
3 Replies

7. Shell Programming and Scripting

Converting Date from YYYYMMDD to DD-MON-YYYY

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

8. Shell Programming and Scripting

Converting filenames from julian day to yyyy-mm-dd and retrieving weekly mean values

Hi, I need help to convert the filenames of my 9-year daily files (1999-2007) from a julian day to yyyy-mm-dd format. my original files are patterned likes the ones below. 1999001.txt 1999002.txt 1999003.txt 1999004.txt ... 1999365.txt desired output: 19990101.txt 19990102.txt... (3 Replies)
Discussion started by: ida1215
3 Replies

9. Shell Programming and Scripting

Issue in Julian date conversion

All, I am facing an issue with julian date conversion.. current command: echo `date +%Y%j` `cat -n /home/user/FILENAME.dat |awk '{printf "%08s", $2}'` The above command is working good. But in the above bolded part, it is converting system date to julian date. However I want to... (8 Replies)
Discussion started by: cmaroju
8 Replies

10. Shell Programming and Scripting

Addition to Julian date

Need assistance . Below code gets me julian date . I wanted to add hour/24 to julian date and output it. Is there a way to do the calculation? use Time::Local; use POSIX qw(strftime); my $time=timelocal(1,2,3,9,11,2013); printf strftime "%j", localtime($time); 343 (3 Replies)
Discussion started by: ajayram_arya
3 Replies
SLAPD-PERL(5)							File Formats Manual						     SLAPD-PERL(5)

NAME
slapd-perl - Perl backend to slapd SYNOPSIS
/etc/openldap/slapd.conf DESCRIPTION
The Perl backend to slapd(8) works by embedding a perl(1) interpreter into slapd(8). Any perl database section of the configuration file slapd.conf(5) must then specify what Perl module to use. Slapd then creates a new Perl object that handles all the requests for that par- ticular instance of the backend. You will need to create a method for each one of the following actions: * new # creates a new object, * search # performs the ldap search, * compare # does a compare, * modify # modifies an entry, * add # adds an entry to backend, * modrdn # modifies an entry's rdn, * delete # deletes an ldap entry, * config # process unknown config file lines, * init # called after backend is initialized. Unless otherwise specified, the methods return the result code which will be returned to the client. Unimplemented actions can just return unwillingToPerform (53). new This method is called when the configuration file encounters a perlmod line. The module in that line is then effectively `use'd into the perl interpreter, then the new method is called to create a new object. Note that multiple instances of that object may be instantiated, as with any perl object. The new method receives the class name as argument. search This method is called when a search request comes from a client. It arguments are as follows: * object reference * base DN * scope * alias dereferencing policy * size limit * time limit * filter string * attributes only flag (1 for yes) * list of attributes to return (may be empty) Return value: (resultcode, ldif-entry, ldif-entry, ...) compare This method is called when a compare request comes from a client. Its arguments are as follows. * object reference * dn * attribute assertion string modify This method is called when a modify request comes from a client. Its arguments are as follows. * object reference * dn * a list formatted as follows ({ "ADD" | "DELETE" | "REPLACE" }, attributetype, value...)... add This method is called when a add request comes from a client. Its arguments are as follows. * object reference * entry in string format modrdn This method is called when a modrdn request comes from a client. Its arguments are as follows. * object reference * dn * new rdn * delete old dn flag (1 means yes) delete This method is called when a delete request comes from a client. Its arguments are as follows. * object reference * dn config This method is called with unknown slapd.conf(5) configuration file lines. Its arguments are as follows. * object reference * array of arguments on line Return value: nonzero if this is not a valid option. init This method is called after backend is initialized. Its argument is as follows. * object reference Return value: nonzero if initialization failed. CONFIGURATION
These slapd.conf options apply to the PERL backend database. That is, they must follow a "database perl" line and come before any subse- quent "backend" or "database" lines. Other database options are described in the slapd.conf(5) manual page. perlModulePath /path/to/libs Add the path to the @INC variable. perlModule ModName `Use' the module name ModName from ModName.pm filterSearchResults Search results are candidates that need to be filtered (with the filter in the search request), rather than search results to be returned directly to the client. EXAMPLE
There is an example Perl module `SampleLDAP' in the slapd/back-perl/ directory in the OpenLDAP source tree. ACCESS CONTROL
The perl backend does not honor any of the access control semantics described in slapd.access(5); all access control is delegated to the underlying PERL scripting. Only read (=r) access to the entry pseudo-attribute and to the other attribute values of the entries returned by the search operation is honored, which is performed by the frontend. WARNING
The interface of this backend to the perl module MAY change. Any suggestions would greatly be appreciated. FILES
/etc/openldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd(8), perl(1). OpenLDAP 2.4.28 2011/11/24 SLAPD-PERL(5)
All times are GMT -4. The time now is 10:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy