473,396 Members | 1,913 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,396 software developers and data experts.

JulianDate

I can't find anything decent on how to convert a regular DateTime, or a
string, to Julian Date. Help?

Thanks,
Sueffel
Nov 16 '05 #1
4 2622
Hi Sueffel
there is a good example with souce code on this link
http://www.thecodeproject.com/csharp/GregToISO.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
That's kool, but, I may have been misunderstood. I need to convert 1/1/04
to 04001, and I'm native to VB.NET, so it makes thing even more difficult.

Thank,
Sueffel
"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message
news:SF**************@cpmsftngxa10.phx.gbl...
Hi Sueffel
there is a good example with souce code on this link
http://www.thecodeproject.com/csharp/GregToISO.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3
hi
one other way to go about it is to convert the data to string ( using the
ToString() method of the data object ) then do the manipulation on the
string it self , I think this would be easier since you will find a lot of
simple examples on how to handle strings ....
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #4
Sueffel wrote:
That's kool, but, I may have been misunderstood. I need to convert 1/1/04
to 04001, and I'm native to VB.NET, so it makes thing even more difficult.
It looks like you want a date formatted as YYDDD, where DDD is the
number of days into the particular year. This is sometimes called a
Julian Date Format, confusingly so, since it really has nothing to do
with a Julian Date (as astronomers use it).

Anyway, you can get what you want with something like:

String.Format( "{0:2}{1:3}", dt.ToString( "yy"),
dt.DayOfYear.ToString( "000"))

Thank,
Sueffel
"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message
news:SF**************@cpmsftngxa10.phx.gbl...
Hi Sueffel
there is a good example with souce code on this link
http://www.thecodeproject.com/csharp/GregToISO.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC


--
mikeb
Nov 16 '05 #5

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

Similar topics

1
by: Jack | last post by:
Hi, Using VbScript in an ASP page, I want to access a database stored on the AS/400. Should I use ADO, ODBC or anyother way of doing it? And is it possible to have some sample codes? Thanks...
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...
2
by: Satish | last post by:
Hi All, I would like to convert Julian timestamp to readable time format. WHich C function or c++ function should I use? Thanks, Satish
1
by: Kiran | last post by:
Hi, Please help me on converting julian date into dd MMM yyyy format in c#. Ex of julian date: 1093128564 1093128537 1093128419
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...
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...
15
by: toadmaster | last post by:
I am new to access and I am learning as I go along; I am attempting to convert Julian dates to regular dates "MM-DD-YY"; I have tried the code below in the Query screen under criteria. ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.