473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Julian Date from Date

Hi Everyone,

Need to find code to convert short date (1/20/2003) into Julian Date 3020.
The "3" is last digit of year and 020 is the number of days since January
1st.

Thanks,
Kevin
Nov 12 '05 #1
3 10930
"Kevin Baker" <shcbaker[removeme]@cox.net> wrote in
news:eiVrb.14714$oB3.13943@lakeread03:
Hi Everyone,

Need to find code to convert short date (1/20/2003) into
Julian Date 3020. The "3" is last digit of year and 020 is the
number of days since January 1st.

Thanks,
Kevin
If I typed correctly, use one or the other:

Jint = (Year(shortdate) mod 3)*1000 +
datediff("y",dateserial((year(shortdate),1,1),shor tdate)

Jtxt =right(cstr(Year(shortdate),1)) &
cstr(datediff("y",dateserial((year(shortdate),1,1) ,shortdate))

Watch the word wrap!

Bob Q
Nov 12 '05 #2

"Kevin Baker" > wrote
Need to find code to convert short
date (1/20/2003) into Julian Date 3020.
The "3" is last digit of year and 020 is
the number of days since January
1st.


Copied from the Immediate Window:

? Right(Year(#1/20/2003#),1) &
Format(DateDiff("d",#1/1/2003#,#1/20/2003#)+1,"000")
3020

That is not what I remember the definition of Julian (computer) Date,
though. It was either YYDDD or YYYYDDDD, depending on the implementer, but
never YDDD. Are you planning on a very short lifespan for your application?
If it lasts 8 years, and many applications do, you won't be able to tell
1/20/2001 from 1/20/2011.

But, of course, you are unlikely to ever be called to account for a Y3K
problem or even a Y2.1K problem. <G>

Larry Linson
Microsoft Access MVP
Nov 12 '05 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

And another country heard from....

Immediate window testing (watch out for line wrap):

? right$(format("1/20/2003","yy"),1) & format(format("1/20/2003", "y"
),"000")
3020

MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP7CWA4echKqOuFEgEQJHFgCfQ6X5dQ2kJ+mIm07JLsDCAR HA/1AAoPSQ
6gKH3Fgv+bZl6uDS571mj8Kh
=g3cz
-----END PGP SIGNATURE-----

Kevin Baker wrote:
Hi Everyone,

Need to find code to convert short date (1/20/2003) into Julian Date 3020.
The "3" is last digit of year and 020 is the number of days since January
1st.

Thanks,
Kevin


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: goochey | last post by:
I'm trying to convert a Julian Date (Format "4365") into an actual calendar date in Visual Basic, can anyone help me out with this.
3
by: sunny076 | last post by:
Hi, I am trying to convert from Julian to Gregorian data in C#. I was exploring teh JulianCalendar and Gregorian calendar classes but still not sure how I can do it. For example, the Julian date...
9
by: Reggie | last post by:
Hi and TIA! I have a field that I want to convert from Julian to a short date. I've tried several procedures, but can't come up with the right solution. What I'm trying to do is convert 4023...
3
by: Chris Davoli | last post by:
Is there a class that converts from Gregorian date to TRUE Julian Date in ..NET? Any VB.NET examples available? ie; The Julian date is calculated by the number of days since January 1, 4713 BC....
11
by: Karl O. Pinc | last post by:
Hi, What's the best way to obtain the Julian day from a postgresql date? PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux...
2
by: Rajat | last post by:
Hi, I have to draw a real time chart in which I have several entries at the same second (i.e. HH:MM:SS:Milleconds) The charting component only takes julian date for drawing the dates. I am...
4
by: Bit byte | last post by:
How may I represent dates as Julian dates - I have seen code where julian dates are represented as longs, and other where they are represented as floats. Which is the correct representation? ...
14
by: pdavis06 | last post by:
I know that there is a thread about this, but I was unable to add to it; I just joined. The problem is that I do not want to change the date format for the entire database output, merely for a header...
4
by: IsdWeb | last post by:
Hello, I am a newbie to coding and need some help. I am trying to figure out why the following code is not producing the correct Julian date. Any suggestions? Also, I am trying to understand...
1
by: smdmca | last post by:
I have Julian date, I want to convert it into date. Is there any function in MySql to convert Julian date to date eg- Julian Date- 2455116 Date - Oct - 12, 2009
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.