• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 829
  • Last Modified:

julien date to yyyymmdd script needed

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
leonardocoe
Asked:
leonardocoe
1 Solution
 
leonardocoeAuthor Commented:
thanks
0
 
TintinCommented:
I suspect you mean day of year rather than julian date.

Julian date is the number of days since January 1, 4713 BCE
0
 
ProgSysAdminCommented:
what language are you working with?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ozoCommented:
#!/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
 
ahoffmannCommented:
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
 
leonardocoeAuthor Commented:
julian date ...

date '+%j'

052

need to change 052 back to 2003 02 21

thanks
0
 
leonardocoeAuthor Commented:
thanks for all the help .... I used ozo comment.
0
 
leonardocoeAuthor Commented:
It worked in my mkstoolkit emulator shell on nt ...thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now