.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Handling different Time Zones

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Sql Server

I have SSAS 2008 with sql server 2005 database as a source. Currently, we store all dates in UTC time and use system generated Time dimension in the cube.

Up until recently the granularity of a day was just fine for our needs.

Now, I've been asked to redesign DateTime dimension so it allows for different time zones, as we need to send out reports to users in different time zones.

I read up on the subject on the web and I found this article


It calls for creation of LocalTime, UTCTime, TimeZone dimensions, UTCToLocal "bridge" fact table and Many-to-Many relationship between LocalTime and my own fact table.

Question: what is the best way to create/populate LocalTime & UTCTime dimensions so they include hours?

Most of the articles about Time dimension call for 2 separate tables - Date(Year-Month-Week-Day) and TimeOfDay ( Hour-Min-Sec), but in my case,  I need to have  hours in the LocalTime & UTCTime tables.


View Complete Post

More Related Resource Links

Windows CE 3.0: Enhanced Real-Time Features Provide Sophisticated Thread Handling


Windows CE is a small, configurable, feature-rich, real-time operating system. In Windows CE 3.0, the real-time support has been improved. This article looks at specific support for the creation of real-time systems and how it compares to the support in Windows for the desktop. The way interrupt handlers, processes, memory management, and synchronization work in Windows CE 3.0 is discussed. An extensive look at threads and thread priority, misconceptions surrounding them, and their impact on performance is included. Refinements to the Windows CE scheduler and support for nestable interrupts are also covered.

Paul Yao

MSDN Magazine November 2000

BCS - Datetime field and time zones


I have an external list that has a datetime column. I get the value for this column from my SQL server database.

The value in the database is '2010-10-30 17:00:00.000', but when the value is displayed in my external list it is converted to '2010-10-30 18:00:00.000'. This is done because the time zone for my sharepoint site is set to UTC+1.

I do not want SharePoint to convert the datetime. I want the value in external list to be '2010-10-30 17:00:00.000' no matter what the time zone is set to on my site.

How can I do that?


UTC Offset Lookup Table for different Time Zones with Daylight Saving.



I am trying to populate a table for on SQL 2008 Server which should have start datetime and end datetime for daylight saving for various world time zones. So that I can lookup if a particular date is between startdate and enddate and get UTC offset.

Something like the following table. Checked this link but not sure if I can use it in anyway for the information I am looking for or need something completely different.


I not an SQL expert and finding it really difficult to get solution for this problem which I am facing.

Appreciate help.



InfoPath 2007 display date for multiple time zones



We have an InfoPath 2007 form integrated with SharePoint 2007 and uses Web Service as Data Sources. The end users are located in multiple time zones in US and Australia. The server is located in US Eastern time zone. We would like the form to display user's local date and time.

The return of web service shows correct local date and time, except the time zone keeps at -04:00. For example during the one hour after midnight Eastern Time, the web services return:

Eastern: 2011-04-13T00:04:03.793537-04:00

Central: 2011-04-12T23:04:15.5734594-04:00

Mountain: 2011-04-12T22:04:24.3693642-04:00

Eastern Australia: 2011-04-13T15:04:18.8366836-04:00

When I preview the form it shows correct date, but after uploading it to SharePoint and view in web browser, the date is off by one day (either ahead or behind).

My looked at this post http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/677c03e4-8d71-43b3-aff9-1b6662a2528a but I don't get how it display different dates in different timezones by using UTC.

How can I make sure the form ignores the server time or the time zone indicated in the web service return, and just display the date as it is?



Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.

Date/Time Conversions Using SQL Server

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.

Date and Time Data Types and Functions

The following sections in this topic provide an overview of all Transact-SQL date and time data types and functions. For information and examples that are common to date and time data types and functions
The Time Zone
DST Start DST End Offset for UTC
EST 3/13/11 4:00 11/6/11 3:00 240
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend