Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default converte date julian to greagorian in VBA

Dear friends, I need convert date Julian to gregorian and gregorian to Julian.
Help me.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default converte date julian to greagorian in VBA

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 ,
Ienidualc wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default converte date julian to greagorian in VBA

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" wrote in message
...
Dear friends, I need convert date Julian to gregorian and gregorian to

Julian.
Help me.
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default converte date julian to greagorian in VBA

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 ,
Ienidualc wrote:

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default converte date julian to greagorian in VBA

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 ,
Ienidualc wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Change satellite julian date format YYYYDDDHHMMSS to excel date ti putley Excel Discussion (Misc queries) 1 January 11th 08 06:12 PM
to convert a julian date back to regular date Lynn Hanna Excel Worksheet Functions 1 July 26th 06 03:14 PM
Convert a julian gregorian date code into a regular date Robert Excel Worksheet Functions 3 June 13th 06 07:03 PM
how to convert julian date to regular calendar date Ron Excel Worksheet Functions 5 May 5th 05 11:05 PM


All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"