Get Date from Web Server or DB Server?
-
Hi gurus, I wonder whether it's better to pass the current date to my DAL from my BLL or do this in my sproc (using GetDate() in SQL Server for example), or in others words is it better to get the date from the web server or the db server? What are the pros and cons of every approach? (in case you're wondering it's a website with a forums section and I want this for the thread adding code) Regards
Waleed Eissa Software Developer Sydney
-
Hi gurus, I wonder whether it's better to pass the current date to my DAL from my BLL or do this in my sproc (using GetDate() in SQL Server for example), or in others words is it better to get the date from the web server or the db server? What are the pros and cons of every approach? (in case you're wondering it's a website with a forums section and I want this for the thread adding code) Regards
Waleed Eissa Software Developer Sydney
I don't think it matters unless you are worried the dates will differ. I'd use getdate b/c it's there and just works without passing anything in
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I don't think it matters unless you are worried the dates will differ. I'd use getdate b/c it's there and just works without passing anything in
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Christian Graus wrote:
unless you are worried the dates will
The time component might present a problem if the servers are distributed across geographically, unless the timezones are taken care of properly.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson