Print

Print


Hi Matthew,

Are the calendars you are after not in the System.Globalization
namespace ? Most dates can be transformed using the CultureInfo class ..

	public static void Main()
	{
	DateTime dt = DateTime.Now;

	// Create a CultureInfo object for German in Germany.
	CultureInfo ci = new CultureInfo("de-DE");

	// Display dt, formatted using the ShortDatePattern
	// and the CultureInfo object.
	Console.WriteLine(dt.ToString("d", ci));
	}

http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinf
o.aspx

Julian -
http://msdn2.microsoft.com/en-us/library/system.globalization.juliancale
ndar.aspx
Gregorian -
http://msdn2.microsoft.com/en-us/library/system.globalization.gregorianc
alendar.aspx

Various calendars can be found under ..
http://msdn2.microsoft.com/en-us/library/system.globalization.aspx

Not sure if things such as Ethiopic (Amharic) language packs need to be
installed before they are available as cultures or if this includes
their specific calendars..
http://www.hanselman.com/blog/MUIsAndLIPsHowToWriteInChineseAndLocalizeW
indowsInYourLanguage.aspx

Quick example code for dumping out a cultures optional calendars..

using System;    
using System.Globalization;
public class TestClass
{
    public static void Main()
    {
    // Create a CultureInfo object for Thai in Thailand.
    CultureInfo th = new CultureInfo("th-TH");
    DisplayCalendars(th);
    }

    protected static void DisplayCalendars(CultureInfo cultureinfo)
    {
    CultureInfo ci = new CultureInfo(cultureinfo.ToString());

    // Display the default calendar for the culture.
    if (ci.Calendar is GregorianCalendar)
        Console.WriteLine ("\n\n");
        Console.WriteLine ("The default calendar for the {0} culture is:
\n{1}\n\n", _
        ci.DisplayName.ToString(), ci.Calendar.ToString() + " subtype "
+ _
        ((GregorianCalendar)ci.Calendar).CalendarType.ToString());
    else
        Console.WriteLine ("\n\n");
        Console.WriteLine ("The default calendar for the {0} culture is:
\n{1}\n\n", _
        ci.DisplayName.ToString(), ci.Calendar.ToString());
    // Display the optional calendars for the culture.
    Console.WriteLine ("The optional calendars for the {0} culture are:
", _
    ci.DisplayName.ToString());
    for (int i = ci.OptionalCalendars.GetLowerBound(0); i <= _
	    ci.OptionalCalendars.GetUpperBound(0);i++ )
        {
        if (ci.OptionalCalendars[i] is GregorianCalendar)
            {
            // Display the calendar subtype.
            String CalStr = (ci.OptionalCalendars[i].ToString() + "
subtype " + _
 
((GregorianCalendar)ci.OptionalCalendars[i]).CalendarType.ToString());
            Console.WriteLine(CalStr);
            }
        else
            Console.WriteLine (ci.OptionalCalendars[i].ToString());
        }
    }
}

.. should produce the output:

The default calendar for the Thai (Thailand) culture is:
		System.Globalization.ThaiBuddhistCalendar


The optional calendars for the Thai (Thailand) culture are:
System.Globalization.ThaiBuddhistCalendar
System.Globalization.GregorianCalendar
subtype Localized

etc etc.

Hope this helps... sorry if you'd tried this .. im not sure how ancient
the calendars you want to display .. also sorry for the code splurge !
:)

Stephen

Senior Developer

Eduserv

-----Original Message-----
From: Museums Computer Group [mailto:[log in to unmask]] On Behalf Of
Matthew Cock
Sent: 24 April 2008 13:22
To: [log in to unmask]
Subject: Calendars

Thanks to all who helped with my enquiry about developer posts.
 
Another question - does anyone out there have any experience with
calendars?
 
We're looking at developing a screen in a gallery which would show
today's date in 8-12 different calendars e.g. Gregorian, Julian,
Chinese, Ethiopic etc. This would change each day. We run a .NET
environment, which supports some of these calendars, but for others we
would have to somehow create a convertor that drew on 3rd party calendar
programmes that we would have to source...

 

We would be really grateful if anyone had any experience, and even
better if a company had some!

Do go off list if you prefer.

 

Thanks,

Matthew

 
Head of Web | Department of Learning and Audiences| The British Museum |
www.britishmuseum.org <http://www.britishmuseum.org/> 
t: 020 7323 8169 | m: 07971 433841
 

HADRIAN: EMPIRE AND CONFLICT
Exhibition opens 24 July 2008
Discover the life, love and legacy of Rome's most enigmatic emperor.
BOOK TICKETS NOW
+44 (0)20 7323 8181
www.britishmuseum.org 


**************************************************
For mcg information and to manage your subscription to the list, visit
the website at http://www.museumscomputergroup.org.uk
**************************************************



Unless otherwise agreed expressly in writing by a senior manager of 
Eduserv, this communication is to be treated as confidential and the 
information in it may not be used or disclosed except for the purpose
for which it has been sent.
If you have reason to believe that you are not the intended recipient
of this communication, please contact the sender immediately.
No employee or agent is authorised to enter into any binding agreement
or contract on behalf of Eduserv or Eduserv Technologies Ltd., unless
that agreement is subsequently confirmed by the conclusion of a written
contract or the issue of a purchase order.
Eduserv (Limited by Guarantee) – company number 3763109 - and 
Eduserv Technologies Ltd – company number – 4256630 - are both 
companies incorporated in England and Wales and have their registered 
offices at Queen Anne House, 11 Charlotte Street, Bath, BA1 2NE.


**************************************************
For mcg information and to manage your subscription to the list, visit the website at http://www.museumscomputergroup.org.uk
**************************************************