denny911 Posted December 30, 2005 Share Posted December 30, 2005 Hello everyone,i have uploaded my site for testing purposes. i use an MS database and when i open my site from localhost, dates and times are shown like this:28.12.2005 15:04:29But, when i open the same page from internet, the same date and time are shown like this:12/28/2005 8:04:29 AMi realize that the server time is used in both cases. since im in bosnia and herzegovina, the first date and time format are what i want.but, my hosting server is probably somewhere in USA (since the other time is 7 hours behind).Now, i want to know if there is any way to make my server display GMT+1 time instead of that of my hosting server?Any suggestions, anyone?THX Link to comment Share on other sites More sharing options...
aspnetguy Posted December 30, 2005 Share Posted December 30, 2005 You could find out where your host is and determine the hour difference. Then before displaying the date add/subtract the needed amount of hours. DATEADD("h",7,NOW( )) The above code adds 7 hours to the current date time. Link to comment Share on other sites More sharing options...
denny911 Posted December 31, 2005 Author Share Posted December 31, 2005 You could find out where your host is and determine the hour difference. Then before displaying the date add/subtract the needed amount of hours.DATEADD("h",7,NOW( )) The above code adds 7 hours to the current date time. <{POST_SNAPBACK}> you see, i know for sure that the time difference is 7 hours. in my database i have the date/time fields which are filled automatically since their default value is set to Now()How can i change the time format of my hosting server to show the current time + 7hours and also to show date in this format: 31.12.2005 and not 12/31/2005?Thx Link to comment Share on other sites More sharing options...
aspnetguy Posted December 31, 2005 Share Posted December 31, 2005 First of all use the function I provided to add the 7 hours first.Then read thishttp://www.codetoad.com/asp/format_date_time.aspLook at the bottom of the page about International Date Time. It tells you the codes that will change the date format. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now