PC Review


Reply
Thread Tools Rate Thread

converte date julian to greagorian in VBA

 
 
=?Utf-8?B?SWVuaWR1YWxj?=
Guest
Posts: n/a
 
      8th May 2007
Dear friends, I need convert date Julian to gregorian and gregorian to Julian.
Help me.
Thanks
 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      8th May 2007
One way:

Const cdCONVERT As Double = 2415018.5 'adjust for time zone
Dim dGregorian As Double
Dim dJulian As Double

dGregorian = Now
dJulian = dGregorian + cdCONVERT
MsgBox Format(dGregorian, "dd mmm yyyy") & vbNewLine & dJulian



Ref: http://aa.usno.navy.mil/data/docs/JulianDate.html



In article <5418F4FF-8298-47A2-8881-(E-Mail Removed)>,
Ienidualc <(E-Mail Removed)> wrote:

> Dear friends, I need convert date Julian to gregorian and gregorian to Julian.
> Help me.
> Thanks

 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      8th May 2007
A quick Google should give you some ideas:
http://www.freevbcode.com/ShowCode.asp?ID=1670
You can open the *.frm file your favourite text editor.

NickHK

"Ienidualc" <(E-Mail Removed)> wrote in message
news:5418F4FF-8298-47A2-8881-(E-Mail Removed)...
> Dear friends, I need convert date Julian to gregorian and gregorian to

Julian.
> Help me.
> Thanks



 
Reply With Quote
 
=?Utf-8?B?SWVuaWR1YWxj?=
Guest
Posts: n/a
 
      9th May 2007
Thank you for your response.
but I need "convert date julian to greagorian and gregorian to Julian" in
that exemple (Format):
Date Gregorian Date Jualian
DD/MM/YYYY YYYYJJJ

have a nice day.
thanks again


"JE McGimpsey" wrote:

> One way:
>
> Const cdCONVERT As Double = 2415018.5 'adjust for time zone
> Dim dGregorian As Double
> Dim dJulian As Double
>
> dGregorian = Now
> dJulian = dGregorian + cdCONVERT
> MsgBox Format(dGregorian, "dd mmm yyyy") & vbNewLine & dJulian
>
>
>
> Ref: http://aa.usno.navy.mil/data/docs/JulianDate.html
>
>
>
> In article <5418F4FF-8298-47A2-8881-(E-Mail Removed)>,
> Ienidualc <(E-Mail Removed)> wrote:
>
> > Dear friends, I need convert date Julian to gregorian and gregorian to Julian.
> > Help me.
> > Thanks

>

 
Reply With Quote
 
JW
Guest
Posts: n/a
 
      9th May 2007
Here are two functions tht I use for this purpose. The aDate converts
a Julian date to a regular data. jDate converts regular date to
Julian. I am only returning a 5 digit Julian date, but you can adjust
that to pull in the entire year if needed. HTH
'Gets Julian date from standard date
Function jDate(aDate As Date)
NormDateYear = Format(aDate, "yy")
NormDateDay = Format(Str(aDate - _
DateValue("1/1/" & Str(NormDateYear)) + 1), "000")
jDate = Format(NormDateYear & NormDateDay, "@")
End Function

'Gets standard date from Julian date
Function aDate(jDate As String)
NormDateYear = CInt(Mid(jDate, 1, 2))
If NormDateYear < 30 Then
NormDateYear = NormDateYear + 2000
Else
NormDateYear = NormDateYear + 1900
End If
NormDateDay = CInt(Mid(jDate, 3, 3))
aDate = DateSerial(NormDateYear, _
1, NormDateDay)
End Function
Ienidualc wrote:
> Thank you for your response.
> but I need "convert date julian to greagorian and gregorian to Julian" in
> that exemple (Format):
> Date Gregorian Date Jualian
> DD/MM/YYYY YYYYJJJ
>
> have a nice day.
> thanks again
>
>
> "JE McGimpsey" wrote:
>
> > One way:
> >
> > Const cdCONVERT As Double = 2415018.5 'adjust for time zone
> > Dim dGregorian As Double
> > Dim dJulian As Double
> >
> > dGregorian = Now
> > dJulian = dGregorian + cdCONVERT
> > MsgBox Format(dGregorian, "dd mmm yyyy") & vbNewLine & dJulian
> >
> >
> >
> > Ref: http://aa.usno.navy.mil/data/docs/JulianDate.html
> >
> >
> >
> > In article <5418F4FF-8298-47A2-8881-(E-Mail Removed)>,
> > Ienidualc <(E-Mail Removed)> wrote:
> >
> > > Dear friends, I need convert date Julian to gregorian and gregorian to Julian.
> > > Help me.
> > > Thanks

> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change satellite julian date format YYYYDDDHHMMSS to excel date ti putley Microsoft Excel Misc 1 11th Jan 2008 06:12 PM
Pulling a date from a two digit year and julian date Ziggs Microsoft Access 3 25th Dec 2006 07:59 PM
Convert a julian gregorian date code into a regular date =?Utf-8?B?Um9iZXJ0?= Microsoft Excel Worksheet Functions 3 13th Jun 2006 07:03 PM
how to convert julian date to calendar date in access 2003 =?Utf-8?B?YXJrcHJhYmhh?= Microsoft Access Database Table Design 1 5th Apr 2006 02:23 PM
How to convert normal date to Julian date upto milliseconds precision Rajat Microsoft C# .NET 2 21st Mar 2006 06:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:26 AM.