-
Re: How to Convert the Julian Date to Normal Date?
Maford,
I did a quick test and a quick search of the VB help facility but did not
find anything 'satisfactory'. You can, however, use an array to "convert"
your day to month-day. The values in your array would be the total number
of days in the year, up to, but not including the current month, for non
leap years: #1 = 0, #2 = 31, #3 =59, #4 = 90, etc. Search the array for
the value that is lower(!) than your day, if your array has option base 1
then, the entry will represent the month. Your loop would have something
like:
If myJDays > Array(x) Then
x = x - 1
Exit For
End If
Subtract the array entry from your day to get the day of the month.
You can also use the array to convert mm-dd back to Julian by adding the
array entry(month) to the day of the month, e.g. 01-23 would be array(1)
+ 23 or 0 + 23 = 023; 02-02 would be array(2) + 2 or 31 + 2 = 033; etc.
I would put the whole business in a class module that I could use to do it
for me... (Maybe I'll write one today....)
There are, definitely, other ways to do this, but this will at least work.
Craig Brown
"Maford" <mayee_yra@hotmail.com> wrote:
>Hi.
>
>Does anyone know how to convert the Julian Date to Normal Date in Visual
>Basic 6?
>
>Thanks in advance.
>Mayee
>
>
-
Re: How to Convert the Julian Date to Normal Date?
Use DateAdd. 1=Jan 1 so for 01257 Add 257 days to 31 Dec 2000.
"Maford" <mayee_yra@hotmail.com> wrote in message
news:3abb21ba@news.devx.com...
> Hi.
>
> Does anyone know how to convert the Julian Date to Normal Date in Visual
> Basic 6?
>
> Thanks in advance.
> Mayee
>
>
-
How to Convert the Julian Date to Normal Date?
Hi.
Does anyone know how to convert the Julian Date to Normal Date in Visual
Basic 6?
Thanks in advance.
Mayee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks