Click here to Skip to main content
Licence CPOL
First Posted 3 Feb 2007
Views 24,445
Downloads 819
Bookmarked 24 times

Persian DateTime

By Mohammad Mir mostafa | 25 Apr 2011
A structure like System.DateTime which is designed to support Persian calendar
5 votes, 38.5%
1

2

3
2 votes, 15.4%
4
6 votes, 46.2%
5
2.55/5 - 13 votes
μ 2.62, σa 3.51 [?]

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
QuestionCode Usage PinmemberMember 827970810:53 30 Sep '11  
Questionthankful for you Pinmemberamir 223:10 1 Aug '11  
Generalhi Pinmemberraha_45523:53 4 Feb '11  
GeneralMy vote of 5 PinmemberSayyeid Mostafa Hashemi4:50 21 Dec '10  
GeneralMonth names PinmemberKamranBehzad20:01 14 Jun '10  
GeneralRe: Month names PinmemberMohammad Mir mostafa0:37 15 Jun '10  
GeneralAddDays Pinmembershervin19:20 12 Mar '10  
GeneralBut PinmemberMember 67145010:56 15 Nov '09  
GeneralRe: But PinmemberMohammad Mir mostafa3:34 16 Nov '09  
Generaltank you Pinmembers_ahmadneya2:03 30 Dec '08  
GeneralThank You PinmemberMember 193372921:40 19 Sep '08  
GeneralThanks PinmemberB.Farivar0:54 9 Jul '08  
GeneralC sharp Code Generator PinmemberHemant.Kamalakar5: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.120206.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