Re: DateTime problem
From: Jacco Schalkwijk (NOSPAMjaccos_at_eurostop.co.uk)
Date: 03/15/04
- Next message: Karl Gram: "Re: Error 156: Incorrect syntax near the keyword 'ORDER""
- Previous message: Anith Sen: "Re: Error 156: Incorrect syntax near the keyword 'ORDER""
- In reply to: Blue Man: "Re: DateTime problem"
- Next in thread: Steve Kass: "Re: DateTime problem"
- Messages sorted by: [ date ] [ thread ]
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. > > > > > > > > > > > >
- Next message: Karl Gram: "Re: Error 156: Incorrect syntax near the keyword 'ORDER""
- Previous message: Anith Sen: "Re: Error 156: Incorrect syntax near the keyword 'ORDER""
- In reply to: Blue Man: "Re: DateTime problem"
- Next in thread: Steve Kass: "Re: DateTime problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|