Re: Julian Calendar Class ?
"Z.K." <nospam@nospam.net> ha scritto nel messaggio
news:OtZ5tScEIHA.5752@TK2MSFTNGP02.phx.gbl...
How I use the Julian Calendar Class to convert the current date to Julian
format. Also, I could not seem to find what header file to use in order
to access the class.
I'm sorry, but I don't know of any MFC class of this kind...
Are you referring to System.Globalization.JulianCalendar class?
If so, this is a class exported by the .NET framework, so if you want to use
it from C++, you should use C++/CLI extensions.
I wrote a simple C# code snippet to test this class; converting it to
C++/CLI should not be very hard (e.g. convert Console.WriteLine to
Console::WriteLine, etc.)
<code>
using System;
using System.Text;
using System.Globalization;
namespace CalendarTest
{
class Program
{
static void Main(string[] args)
{
JulianCalendar julianCalendar = new JulianCalendar();
DateTime time = DateTime.Now;
int day = julianCalendar.GetDayOfMonth(time);
int month = julianCalendar.GetMonth(time);
int year = julianCalendar.GetYear(time);
Console.WriteLine("Julian:");
Console.WriteLine(" day: " + day);
Console.WriteLine(" month: " + month);
Console.WriteLine(" year: " + year);
Console.ReadKey();
}
}
}
</code>
Giovanni