Click here to Skip to main content
Licence CPOL
First Posted 3 Feb 2007
Views 26,820
Downloads 1,187
Bookmarked 24 times

Persian DateTime

By | 25 Apr 2011 | Article
A structure like System.DateTime which is designed to support Persian calendar

Introduction

After a long time, I updated this article again. (Happy!!!)

Since the time I can remember, lack of a class or struct to support Persian calendar in programming languages was one of my big problems. Up to the language I was using, I tried to solve this problem with different solutions. But none of them is an absolute solution.

This problem was almost solved in .NET 2.0 by a class named PersianCalendar, but it was not the complete way. So I decided to create a class like System.DateTime.

Background

PersianDateTime is a very simple struct which gives us simple support for Persian DateTime. I'm trying to develop and update it. Therefore it would be great if you leave your suggestions to help me complete it.

Using the Code

A few examples can be found in the source code.

PersianDateTime can be used in two ways: Staticly and instanciately. I mean you can use it with/without an instance:

Console.WriteLine(PersianDateTime.Now);

or:

PersianDateTime persianDateTime = new PersianDateTime(DateTime.Now);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Mohammad Mir mostafa

Program Manager

Iran (Islamic Republic Of) Iran (Islamic Republic Of)

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionSuggestion: Please use better names! PinmemberFlomenol3:20 7 Apr '12  
AnswerRe: Suggestion: Please use better names! PinmemberMohammad Mir mostafa23:23 8 Apr '12  
QuestionCode Usage PinmemberMember 82797089:53 30 Sep '11  
Questionthankful for you Pinmemberamir 222:10 1 Aug '11  
Generalhi Pinmemberraha_45522:53 4 Feb '11  
GeneralMy vote of 5 PinmemberSayyeid Mostafa Hashemi3:50 21 Dec '10  
GeneralMonth names PinmemberKamranBehzad19:01 14 Jun '10  
GeneralRe: Month names PinmemberMohammad Mir mostafa23:37 14 Jun '10  
GeneralAddDays Pinmembershervin18:20 12 Mar '10  
GeneralBut PinmemberMember 671450123:56 14 Nov '09  
GeneralRe: But PinmemberMohammad Mir mostafa2:34 16 Nov '09  
Generaltank you Pinmembers_ahmadneya1:03 30 Dec '08  
GeneralThank You PinmemberMember 193372920:40 19 Sep '08  
Thank You Smile | :)
GeneralThanks PinmemberB.Farivar23:54 8 Jul '08  
GeneralC sharp Code Generator PinmemberHemant.Kamalakar4:34 19 Sep '07  

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

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120604.1 | Last Updated 25 Apr 2011
Article Copyright 2007 by Mohammad Mir mostafa
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid