Click here to Skip to main content
16,006,768 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Optimisation Model Solution Routine(Linear Programming) Pin
Dave Kreskowiak7-Apr-05 4:10
mveDave Kreskowiak7-Apr-05 4:10 
GeneralDatagrid Exporting to Excel Format Pin
Scttsmpsn6-Apr-05 4:53
Scttsmpsn6-Apr-05 4:53 
GeneralRe: Datagrid Exporting to Excel Format Pin
Scttsmpsn6-Apr-05 8:25
Scttsmpsn6-Apr-05 8:25 
QuestionSwitching language programmatically ? Pin
kil0byte^bandit6-Apr-05 4:30
kil0byte^bandit6-Apr-05 4:30 
GeneralMachine.Config Pin
Jason Weibel6-Apr-05 4:25
Jason Weibel6-Apr-05 4:25 
GeneralRe: Machine.Config Pin
Dave Kreskowiak6-Apr-05 4:59
mveDave Kreskowiak6-Apr-05 4:59 
GeneralConvert to(from) Julian Date Format from(to) Calendar Date Pin
Dile6-Apr-05 2:52
Dile6-Apr-05 2:52 
GeneralRe: Convert to(from) Julian Date Format from(to) Calendar Date Pin
kil0byte^bandit6-Apr-05 4:54
kil0byte^bandit6-Apr-05 4:54 
There's a prebuilt class in VB.NET named JulianCalendar that does exactly what you're looking for. JulianCalendar has several methods that'll take any conventional Gregorian date, convert it to a Julian format and send you back the result in any format you wish. I found an example for this in the MSDN2003 libraries. I'm pasting it here for your reference:
===========================================================
' The following code example displays the values of several components of a DateTime in terms of the Julian calendar.

Imports System
Imports System.Globalization


Public Class SamplesJulianCalendar

Public Shared Sub Main()

' Sets a DateTime to April 3, 2002 of the Gregorian calendar.
Dim myDT As New DateTime(2002, 4, 3, New GregorianCalendar())

' Creates an instance of the JulianCalendar.
Dim myCal As New JulianCalendar()

' Displays the values of the DateTime.
Console.WriteLine("April 3, 2002 of the Gregorian calendar equals the following in the Julian calendar:")
DisplayValues(myCal, myDT)

' Adds two years and ten months.
myDT = myCal.AddYears(myDT, 2)
myDT = myCal.AddMonths(myDT, 10)

' Displays the values of the DateTime.
Console.WriteLine("After adding two years and ten months:")
DisplayValues(myCal, myDT)

End Sub 'Main

Public Shared Sub DisplayValues(myCal As Calendar, myDT As DateTime)
Console.WriteLine(" Era: {0}", myCal.GetEra(myDT))
Console.WriteLine(" Year: {0}", myCal.GetYear(myDT))
Console.WriteLine(" Month: {0}", myCal.GetMonth(myDT))
Console.WriteLine(" DayOfYear: {0}", myCal.GetDayOfYear(myDT))
Console.WriteLine(" DayOfMonth: {0}", myCal.GetDayOfMonth(myDT))
Console.WriteLine(" DayOfWeek: {0}", myCal.GetDayOfWeek(myDT))
Console.WriteLine()
End Sub 'DisplayValues

End Class 'SamplesJulianCalendar


'This code produces the following output.

'

'April 3, 2002 of the Gregorian calendar equals the following in the Julian calendar:

' Era: 1

' Year: 2002

' Month: 3

' DayOfYear: 80

' DayOfMonth: 21

' DayOfWeek: Wednesday

'

'After adding two years and ten months:

' Era: 1

' Year: 2005

' Month: 1

' DayOfYear: 21

' DayOfMonth: 21

' DayOfWeek: Thursday
===========================================================

Hope this helps Smile | :)

PeoPLe aRe cRazY anD tiMeS aRe sTRaNGe, i'M LoCKeD iN tiGhT, i'M OuT oF raNGe, i uSeD t0 caRe BuT - thiNGs haVe chaNGeD.
Generalvb Pin
royrana6-Apr-05 1:30
royrana6-Apr-05 1:30 
QuestionDeclare variable at runtime?? Pin
Sheel Gohe5-Apr-05 23:07
Sheel Gohe5-Apr-05 23:07 
AnswerRe: Declare variable at runtime?? Pin
Dave Kreskowiak6-Apr-05 2:20
mveDave Kreskowiak6-Apr-05 2:20 
GeneralRe: Declare variable at runtime?? Pin
royrana6-Apr-05 23:59
royrana6-Apr-05 23:59 
GeneralCOM property from VB Pin
Anonymous5-Apr-05 22:50
Anonymous5-Apr-05 22:50 
GeneralRe: COM property from VB Pin
Dave Kreskowiak6-Apr-05 2:19
mveDave Kreskowiak6-Apr-05 2:19 
GeneralUsing Access 2003 Methods Pin
dpagka5-Apr-05 19:29
dpagka5-Apr-05 19:29 
GeneralRe: Using Access 2003 Methods Pin
Dave Kreskowiak6-Apr-05 2:17
mveDave Kreskowiak6-Apr-05 2:17 
Generalopen ascii file Pin
toto_plg5-Apr-05 19:03
toto_plg5-Apr-05 19:03 
GeneralRe: open ascii file Pin
Christian Graus5-Apr-05 19:44
protectorChristian Graus5-Apr-05 19:44 
GeneralRe: open ascii file Pin
dpagka5-Apr-05 20:03
dpagka5-Apr-05 20:03 
GeneralRe: open ascii file Pin
Christian Graus5-Apr-05 20:05
protectorChristian Graus5-Apr-05 20:05 
GeneralProducing xml file from schema Pin
nitin_ion5-Apr-05 18:16
nitin_ion5-Apr-05 18:16 
GeneralRe: Producing xml file from schema Pin
Christian Graus5-Apr-05 18:39
protectorChristian Graus5-Apr-05 18:39 
GeneralRe: Producing xml file from schema Pin
nitin_ion5-Apr-05 20:14
nitin_ion5-Apr-05 20:14 
GeneralRe: Producing xml file from schema Pin
Christian Graus5-Apr-05 20:17
protectorChristian Graus5-Apr-05 20:17 
GeneralRe: Producing xml file from schema Pin
nitin_ion5-Apr-05 20:23
nitin_ion5-Apr-05 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.