Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Time Zone Adjustment in SQL Server 2005 Express

Author  Topic 

gtrfinger
Starting Member

3 Posts

Posted - 2005-12-18 : 11:31:46
I am using Visual Web Developer 2005 Express Edition & SQL Server 2005 Express Edition.

In a database that is role-manager-enabled, you will have some tables like apsnet_Users, aspnet_Roles, etc.
And some Columns like CreatedDate, LastLoginDate in the tables.

My problem:
The datatime values in the aforementioned fields are updated based on GMT instead of the client's local time zone.

Is this the way it is?
No matter true or not, how to fix it?

Many Thanks in advance :)

Jey Leong

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-18 : 12:40:23
Are you using the getdate() function as a default value , to increment your field ?

if so add the increment to meet your time specifications e.g to increment about 6hours use

getdate() + .3275


Afrika
Go to Top of Page

gtrfinger
Starting Member

3 Posts

Posted - 2005-12-19 : 14:27:17
What is the work around to get 0.3275 for 6 hours?? Or it's just a dummy example??

Sorry I am new, do you mean I have to use the GetDate() function as a parameter when calling the built-in createuser stored procedure? But I am using CreateUserWizard server control, all these should be handled internally right?

By the way, I am occasionally getting a relevant error from the ASP.net Web Site Administration Tool, which goes:

Procedure or Function 'aspnet_Membership_GetUserByName' expects parameter '@TimeZoneAdjustment', which was not supplied. at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_users_edituser_aspx.Page_Load() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\Security\Users\editUser.aspx:line 38 at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The same error happened to other functions like 'aspnet_UsersInRoles_AddUsersToRoles'.

What is going on here???? :s

Jey Leong
Go to Top of Page

gtrfinger
Starting Member

3 Posts

Posted - 2005-12-19 : 14:30:22
Sorry, one more thing to add...

Everything was ok until I changed from MSDE with Framework v1.1 to SQL Server 2005 Express Edition with Framework v2...

I have tried various search engine for this problem and got NOTHING!!

Wonder I am the only one in the world facing this error!??!?! ha!

Jey Leong
Go to Top of Page

Arijit
Starting Member

25 Posts

Posted - 2005-12-20 : 07:53:17
Hi,
I am also little confused with your query..
Suppose one client is accessing the data from India and another is from US.
Then how do you make track of date.
It is better don't distrub the database.Take the control from frontend.
If it is -5/+5 add that value with your datefield.
If its not problematic from your end..I think this is the best solution.
Because I am also doing this for my current proj...
Reg
Arijit
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-20 : 11:13:51
would try to answer your questions as best as possible.

the getdate() function increments by 1, which stands for 24hours. So to get a fraction of the hours you are looking for you divide that to come up with what you want, my suggestion above is a rough estimate.

@TimeZoneAdjustment', which was not supplied. at

the above error means that the parameter @TimeZoneAdjustment which you are passing to your SP is missing

i cant advice abotu using wizards, i personally dont use them. they are good, but make sure you do understand or adjust their codes to suit yourself

afrika
Go to Top of Page
   

- Advertisement -