Sql-server – Partition Function Question – DatetimeOffset

partitioningsql server

I am planning to partition a large table on [datetimeoffset]. I thought the data in that column were all yyyy-mm-dd hh:mm:ss -08:00, but there are multiple offsets in that column such as -07:00 and -06:00.

My question is what should my partition function use? This is what I'm currently using…

CREATE PARTITION FUNCTION [PF_table_DatetimeOffset0] (DATETIMEOFFSET(0))
AS
RANGE RIGHT FOR VALUES (
    '20120101 00:00:00.000 -08:00', 
    '20130101 00:00:00.000 -08:00',  
    '20140101 00:00:00.000 -08:00',
    '20150101 00:00:00.000 -08:00',
    '20150201 00:00:00.000 -08:00',
    '20150301 00:00:00.000 -08:00',
    '20150401 00:00:00.000 -08:00',
    '20150501 00:00:00.000 -08:00',
    '20150601 00:00:00.000 -08:00',
    '20150701 00:00:00.000 -08:00',
    '20150801 00:00:00.000 -08:00',  
    '20150901 00:00:00.000 -08:00',  
    '20151001 00:00:00.000 -08:00',  
    '20151101 00:00:00.000 -08:00',  
    '20151201 00:00:00.000 -08:00',  
    '20160101 00:00:00.000 -08:00'
);

Thank you!

Best Answer

Be aware of the implications in regions that have the nasty habit of changing their clocks twice a year and Check this Link