Re: DateTime problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jacco Schalkwijk (NOSPAMjaccos_at_eurostop.co.uk)
Date: 03/15/04


Date: Mon, 15 Mar 2004 16:02:56 -0000

Hi Blue Man,

Store the dates in SQL Server as "Gregorian" (although actually the dates
are calendar independent), and when you read/write to the database convert
them from Gregorian to Persian and vice versa.

-- 
Jacco Schalkwijk
SQL Server MVP
"Blue Man" <blueman_blog@nospam.com> wrote in message
news:OI$9TFqCEHA.2560@TK2MSFTNGP12.phx.gbl...
> actually I have a class to convert Gregorian to Persian calendar, leap
years
> month days and everything.
> but it seems I can't store these dates to database to perform sql
> operations.  anyway for anybody who may need this converter download it
from
> gotdotnet, named "Pcal" written by  Omid Khandan Rad and suggested to be
> included in .net framework 1.2.
> Bad thing about it is Mysql supports it, we should mention this to
> billy-the-great :)
> thanks for response.
>
>
> "Jacco Schalkwijk" <NOSPAMjaccos@eurostop.co.uk> wrote in message
> news:uHtWsSpCEHA.3132@TK2MSFTNGP11.phx.gbl...
> > SQL Server doesn't support the Persian calendar. You can't really use
the
> > Gregorian calendar with an offset as discussed in the thread that Grant
> > mentions, because months in the Persian calendar have different lenghts
> than
> > munths in the Gregorian calendar, and leap years work differently as
well.
> > So you will have to the Gregorian calendar and write a function that
will
> > calculate the Persian date from the Gregorian date, which looks
manageable
> > with the information in this article:
> > http://www.tondering.dk/claus/cal/
> >
> > -- 
> > Jacco Schalkwijk
> > SQL Server MVP
> >
> >
> > "Blue Man" <blueman_blog@nospam.com> wrote in message
> > news:euE%236KoCEHA.2600@TK2MSFTNGP09.phx.gbl...
> > > Hello group
> > > the datetime that i use is Persian datetime and its year now is 1380
or
> > > something. format doesn't matter something like yyyy-mm-dd but the
> problem
> > > is Year when ever i try to add data i get "DateTime Field overflow".
> > > I checked and realized the date befor year 1800 returns that error.
now
> > what
> > > do you suggest me to do with this type of datetime?
> > > btw my column is smalldatetime, i also tried datetime but nothing
> changed.
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: DateTime problem
    ... > SQL Server doesn't support the Persian calendar. ... > Gregorian calendar with an offset as discussed in the thread that Grant ... > munths in the Gregorian calendar, and leap years work differently as well. ...
    (microsoft.public.sqlserver.programming)
  • Re: FAQ faults
    ... as to which standard is used to make the calculation. ... British Calendar Act of 1751 for Leap Year, and its Annex for Easter. ... multiple non-equivalent standards for our present (Gregorian) Calendar. ...
    (comp.unix.shell)
  • Re: Date arithmetic and Zune bug
    ... | One important bit about anything dealing with Gregorian dates is the ... The Long, Painful History of Time ... calendar back two months... ... to retain the leap day in February. ...
    (comp.arch)
  • Re: Calculating the age given DOB
    ... working in complete months in Gregorian calendars can be tricky. ... aware there isn't a "standard" Ruby way of calculating periods between ... calendar after the datethat the Julian calendar was corrected. ... There are some tricky problems to be solved, ...
    (comp.lang.ruby)
  • Re: February 9, 1665: day of week
    ... "Varia Opera mathematica, accesserunt selectae quaedam ejusdem ... Epistolae, vel ad ipsum a plerisque doctissimis viris gallice, latine ... The GNU/Linux "cal" for calendar ... Similarly, in the Gregorian calendar, ...
    (sci.math)