c# - Representing date having 32 as maximum value for Day -


i building application in asp.net using sql server 2005. in application have represent many dates & dates of nepali(bikram sambhat) in maximum day month can 32.

so best option represent date in sql server 32 can placed day value & can compared(manipulated) in sql server in asp.net?

there isn't easy conversion nepali gregorian. think of in 2 ways:

  • need show nepali date
  • need manipulate (e.g. find difference between months, days etc)

the first 1 easy - store varchar
2nd 1 not. if wanted know difference between 2 nepali dates, can store date 2nd date gregorian equivalent , use datediff/dateadd(day) between them. however, dateadd(month) useless here unless wanted know difference of 2 nepali dates in gregorian date months - not common.

sounds storing in varchar , having library nepali dates, either in front end or clr, go down better.


may conversions have materialized nepali date table corresponding gregorian date, layout

nepaliyear   nepalimonth   nepaliday  gregorian x            4             2          2014-21-23 etc 

but not sure (nepali) date maths beyond conversion - , if need such conversion within sql server.

edit

@pst's comment

there reason prefer varchar datetime. assumed frequency, of activity reading/writing nepali date - stored , read varchar - no conversion. if , when date maths is required involve library - in case invoke conversion, , if need @ point in time gregorian calendar equivalent. if wanted maths between nepalidate/scalar or nepalidate/nepalidate - again, datetime offers no benefit whatsoever - it cannot handle day #32 in month.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -