?
Solved

julien date to yyyymmdd script needed

Posted on 2003-02-20
8
Medium Priority
?
827 Views
Last Modified: 2013-12-26
I need a script to convert the julien date today's(51) to 2003 03 20 ?  Thanks for the script for date to julien, know I need to get back....any help...

thanks
Leonard
0
Comment
Question by:leonardocoe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Author Comment

by:leonardocoe
ID: 7989795
thanks
0
 
LVL 48

Expert Comment

by:Tintin
ID: 7990058
I suspect you mean day of year rather than julian date.

Julian date is the number of days since January 1, 4713 BCE
0
 
LVL 4

Expert Comment

by:ProgSysAdmin
ID: 7990148
what language are you working with?
0
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
LVL 84

Accepted Solution

by:
ozo earned 200 total points
ID: 7991604
#!/bin/sh
dy=${1:-`date +%j`}
y=${2:-`date +%Y`}
l=`expr \( $y % 4 \| $y % 100 = 0 \& $y % 400 \) = 0`
d=`expr $dy + \( $dy \> 59 + $l \) \* \( 2 - $l \)`
m=`expr \( $d + 183 \) \* 12 / 367`
d=`expr $d + 183 - $m \* 367 / 12`
m=`expr \( $m + 6 \) % 12 + 1`
echo $y $m $d
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7993409
I'm confused about the "julian date" also, depending on the contry julian calender endet 1582, 1698, 1752, 1918 AC.
So, do you realy mean julian date? then specify which country and which date (gregorian?)
Or do you just mean the (gregorian) date of the year?

Oops, are you using the catholic (as in most western countries), or the cyrillic (modern, as for example in russia) gregorian calender. We need to know this too (at least for some special dates ;-)
0
 

Author Comment

by:leonardocoe
ID: 7996294
julian date ...

date '+%j'

052

need to change 052 back to 2003 02 21

thanks
0
 

Author Comment

by:leonardocoe
ID: 8019548
thanks for all the help .... I used ozo comment.
0
 

Author Comment

by:leonardocoe
ID: 8038657
It worked in my mkstoolkit emulator shell on nt ...thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question