如何从 tsql (sql 2005) 中的 utc 日期时间计算本地日期时间?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3404646/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 07:05:30  来源:igfitidea点击:

How to calculate the local datetime from a utc datetime in tsql (sql 2005)?

sqlsql-servertsqldatetimetimezone

提问by Michel

i want to loop over a period of time in tsql, and print the utc datetimes and our local variant. We live in UTC +1, so i could easily add 1 hour, but in the summertime we live in UTC +2.

我想在 tsql 中循环一段时间,并打印 utc 日期时间和我们的本地变量。我们住在 UTC +1,所以我可以轻松地增加 1 小时,但在夏季我们住在 UTC +2。

In C# i can create a datetime and use a method to ask for the UTC variant and vice versa.

在 C# 中,我可以创建一个日期时间并使用一种方法来请求 UTC 变体,反之亦然。

Till now i have this:

直到现在我有这个:

declare @counter int
declare @localdate datetime
declare @utcdate datetime
 set @counter = 0
 while @counter < 100
 begin
   set @counter = @counter + 1
   print 'The counter is ' + cast(@counter as char)
  set @utcdate  = DATEADD(day,@counter,GETUTCDATE())
  --set @localdate = ????

  print  @localdate  
  print @utcdate
 end

采纳答案by Neil Moss

Assuming you are using SQL 2005 upwards, you can develop a SQL CLR function to take a UTC date and convert to the local date.

假设您使用 SQL 2005 以上版本,您可以开发一个 SQL CLR 函数来获取 UTC 日期并转换为本地日期。

This linkis an MSDN How-To explaining how you can create a scalar UDF in C#.

此链接是 MSDN How-To 解释如何在 C# 中创建标量 UDF。

Create a SQL function along the lines of

按照以下方式创建 SQL 函数

[SqlFunction()]
public static SqlDateTime ConvertUtcToLocal(SqlDateTime utcDate) 
{
    // over to you to convert SqlDateTime to DateTime, specify Kind
    // as UTC, convert to local time, and convert back to SqlDateTime
}

Your sample above would then become

您上面的示例将变为

set @localdate = dbo.ConvertUtcToLocal(@utcdate)

SQL CLR has its overheads in terms of deployment, but I feel cases like this are where it fits in best.

SQL CLR 在部署方面有其开销,但我觉得这样的情况最适合它。

回答by Bobman

I've been waiting for 5 years for a more elegant solution but since one has not emerged, I'll post what I've been using thus far...

我已经等待了 5 年的更优雅的解决方案,但由于尚未出现,我将发布迄今为止我一直在使用的内容......

CREATE FUNCTION [dbo].[UDTToLocalTime](@UDT AS DATETIME)  
RETURNS DATETIME
AS
BEGIN 
--====================================================
--Set the Timezone Offset (NOT During DST [Daylight Saving Time])
--====================================================
DECLARE @Offset AS SMALLINT
SET @Offset = -5

--====================================================
--Figure out the Offset Datetime
--====================================================
DECLARE @LocalDate AS DATETIME
SET @LocalDate = DATEADD(hh, @Offset, @UDT)

--====================================================
--Figure out the DST Offset for the UDT Datetime
--====================================================
DECLARE @DaylightSavingOffset AS SMALLINT
DECLARE @Year as SMALLINT
DECLARE @DSTStartDate AS DATETIME
DECLARE @DSTEndDate AS DATETIME
--Get Year
SET @Year = YEAR(@LocalDate)

--Get First Possible DST StartDay
IF (@Year > 2006) SET @DSTStartDate = CAST(@Year AS CHAR(4)) + '-03-08 02:00:00'
ELSE              SET @DSTStartDate = CAST(@Year AS CHAR(4)) + '-04-01 02:00:00'
--Get DST StartDate 
WHILE (DATENAME(dw, @DSTStartDate) <> 'sunday') SET @DSTStartDate = DATEADD(day, 1,@DSTStartDate)


--Get First Possible DST EndDate
IF (@Year > 2006) SET @DSTEndDate = CAST(@Year AS CHAR(4)) + '-11-01 02:00:00'
ELSE              SET @DSTEndDate = CAST(@Year AS CHAR(4)) + '-10-25 02:00:00'
--Get DST EndDate 
WHILE (DATENAME(dw, @DSTEndDate) <> 'sunday') SET @DSTEndDate = DATEADD(day,1,@DSTEndDate)

--Get DaylightSavingOffset
SET @DaylightSavingOffset = CASE WHEN @LocalDate BETWEEN @DSTStartDate AND @DSTEndDate THEN 1 ELSE 0 END

--====================================================
--Finally add the DST Offset 
--====================================================
RETURN DATEADD(hh, @DaylightSavingOffset, @LocalDate)
END



GO

Notes:

笔记:

This is for North American servers that observer Daylight Saving Time. Please change the variable @Offest to the Timezone offset of the server running the SQL function (While NOT Observing the Daylight Savings time)...

这是用于观察夏令时的北美服务器。请将变量@Offest 更改为运行 SQL 函数的服务器的时区偏移量(虽然不遵守夏令时)...

--====================================================
--Set the Timezone Offset (NOT During DST [Daylight Saving Time])
--====================================================
DECLARE @Offset AS SMALLINT
SET @Offset = -5

As the DST rules change update them here...

随着 DST 规则的变化,请在此处更新它们...

--Get First Possible DST StartDay
IF (@Year > 2006) SET @DSTStartDate = CAST(@Year AS CHAR(4)) + '-03-08 02:00:00'
ELSE              SET @DSTStartDate = CAST(@Year AS CHAR(4)) + '-04-01 02:00:00'
--Get DST StartDate 
WHILE (DATENAME(dw, @DSTStartDate) <> 'sunday') SET @DSTStartDate = DATEADD(day, 1,@DSTStartDate)


--Get First Possible DST EndDate
IF (@Year > 2006) SET @DSTEndDate = CAST(@Year AS CHAR(4)) + '-11-01 02:00:00'
ELSE              SET @DSTEndDate = CAST(@Year AS CHAR(4)) + '-10-25 02:00:00'
--Get DST EndDate 
WHILE (DATENAME(dw, @DSTEndDate) <> 'sunday') SET @DSTEndDate = DATEADD(day,1,@DSTEndDate)

Cheers,

干杯,

回答by KellySandwiches

This solution seems too obvious.

这个解决方案似乎太明显了。

If you can get UTC Date with GETUTCDATE() and you can get your local date with GETDATE() you have an offset that you can apply for any datetime

如果您可以使用 GETUTCDATE() 获取 UTC 日期,并且可以使用 GETDATE() 获取本地日期,那么您就有了一个可以申请任何日期时间的偏移量

SELECT DATEADD(hh, DATEPART(hh, GETDATE() - GETUTCDATE()) - 24, GETUTCDATE()) 

this should return the local time you executed the query,

这应该返回您执行查询的本地时间,

SELECT DATEADD(hh, DATEPART(hh, GETDATE() - GETUTCDATE()) - 24, N'1/14/2011 7:00:00'  ) 

this will return 2011-01-14 02:00:00.000 because i'm in UTC +5

这将返回 2011-01-14 02:00:00.000 因为我在 UTC +5

Unless I'm missing something?

除非我错过了什么?

回答by Matt Johnson-Pint

You can use my SQL Server Time Zone Supportproject to convert between IANA standard time zones, as listed here.

您可以使用我的SQL Server 时区支持项目在 IANA 标准时区之间进行转换,如下所示

Example:

例子:

SELECT Tzdb.UtcToLocal('2015-07-01 00:00:00', 'America/Los_Angeles')

回答by Ztrauq

Here is a function (again US ONLY) but it is a bit more flexible. It will convert a UTC date to the server local time. It starts by adjusting the appointment date based on the current offset and then adjusts based on the difference of the current offset and the offset of the date of the appointment.

这是一个函数(再次仅限美国),但它更灵活一些。它将 UTC 日期转换为服务器本地时间。它首先根据当前偏移量调整约会日期,然后根据当前偏移量与约会日期的偏移量的差异进行调整。

CREATE FUNCTION [dbo].[fnGetServerTimeFromUTC]
(
    @AppointmentDate AS DATETIME, 
    @DateTimeOffset DATETIMEOFFSET
)
RETURNS DATETIME
AS
BEGIN
    --DECLARE @AppointmentDate DATETIME;
    --SET @AppointmentDate = '2016-12-01 12:00:00'; SELECT @AppointmentDate;

    --Get DateTimeOffset from Server
    --DECLARE @DateTimeOffset; SET @DateTimeOffset = SYSDATETIMEOFFSET();
    DECLARE @DateTimeOffsetStr NVARCHAR(34) = @DateTimeOffset;

    --Set a standard DatePart value for Sunday (server configuration agnostic)
    DECLARE @dp_Sunday INT = 7 - @@DATEFIRST + 1;

    --2006 DST Start First Sunday in April (earliest is 04-01) Ends Last Sunday in October (earliest is 10-25)
    --2007 DST Start Second Sunday March (earliest is 03-08) Ends First Sunday Nov (earliest is 11-01)
    DECLARE @Start2006 NVARCHAR(6) = '04-01-';
    DECLARE @End2006 NVARCHAR(6) = '10-25-';
    DECLARE @Start2007 NVARCHAR(6) = '03-08-';
    DECLARE @End2007 NVARCHAR(6) = '11-01-';

    DECLARE @ServerDST SMALLINT = 0;
    DECLARE @ApptDST SMALLINT = 0;
    DECLARE @Start DATETIME;
    DECLARE @End DATETIME;

    DECLARE @CurrentMinuteOffset INT; 

    DECLARE @str_Year NVARCHAR(4) = LEFT(@DateTimeOffsetStr,4);
    DECLARE @Year INT = CONVERT(INT, @str_Year);

    SET @CurrentMinuteOffset = CONVERT(INT, SUBSTRING(@DateTimeOffsetStr,29,3)) * 60 + CONVERT(INT, SUBSTRING(@DateTimeOffsetStr,33,2)); --Hours + Minutes

    --Determine DST Range for Server Offset
    SET @Start = CASE 
        WHEN @Year <= 2006 THEN CONVERT(DATETIME, @Start2006 + @str_Year + ' 02:00:00')
        ELSE CONVERT(DATETIME, @Start2007 + @str_Year + ' 02:00:00')
        END;
    WHILE @dp_Sunday <> DATEPART(WEEKDAY, @Start) BEGIN
        SET @Start = DATEADD(DAY, 1, @Start)
    END;

    SET @End = CASE 
        WHEN @Year <= 2006 THEN CONVERT(DATETIME, @End2006 + @str_Year + ' 02:00:00')
        ELSE CONVERT(DATETIME, @End2007 + @str_Year + ' 02:00:00')
        END;
    WHILE @dp_Sunday <> DATEPART(WEEKDAY, @End) BEGIN
        SET @End = DATEADD(DAY, 1, @End)
    END;

    --Determine Current Offset based on Year
    IF @DateTimeOffset >= @Start AND @DateTimeOffset < @End SET @ServerDST = 1;

    --Determine DST status of Appointment Date
    SET @Year = YEAR(@AppointmentDate);

    SET @Start = CASE 
        WHEN @Year <= 2006 THEN CONVERT(DATETIME, @Start2006 + @str_Year + ' 02:00:00')
        ELSE CONVERT(DATETIME, @Start2007 + @str_Year + ' 02:00:00')
        END;
    WHILE @dp_Sunday <> DATEPART(WEEKDAY, @Start) BEGIN
        SET @Start = DATEADD(DAY, 1, @Start)
    END;

    SET @End = CASE 
        WHEN @Year <= 2006 THEN CONVERT(DATETIME, @End2006 + @str_Year + ' 02:00:00')
        ELSE CONVERT(DATETIME, @End2007 + @str_Year + ' 02:00:00')
        END;
    WHILE @dp_Sunday <> DATEPART(WEEKDAY, @End) BEGIN
        SET @End = DATEADD(DAY, 1, @End)
    END;

    --Determine Appointment Offset based on Year
    IF @AppointmentDate >= @Start AND @AppointmentDate < @End SET @ApptDST = 1;

    SET @AppointmentDate = DATEADD(MINUTE, @CurrentMinuteOffset + 60 * (@ApptDST - @ServerDST), @AppointmentDate)

    RETURN @AppointmentDate
END
GO

回答by KM.

GETUTCDATE() just gives you the current time in UTC, any DATEADD() you do to this value will not include any daylight savings time shifts.

GETUTCDATE() 只是为您提供 UTC 中的当前时间,您对此值所做的任何 DATEADD() 都不包括任何夏令时转换。

Your best bet is build your own UTC conversion table or just use something like this:

最好的办法是构建自己的 UTC 转换表,或者只使用以下内容:

http://www.codeproject.com/KB/database/ConvertUTCToLocal.aspx

http://www.codeproject.com/KB/database/ConvertUTCToLocal.aspx

回答by asontu

For those stuck in SQL Server 2005 and don't want or can't use a udf - and particularly does outside of the USA - I've taken @Bobman's approach and generalized it. The following will work in the USA, Europe, New Zealand and Australia, with the caveat that not all Australian states observe DST, even states that are in the same "base" timezone. It's also easy to add DST-rules that aren't yet supported, just add a line to the @calculationvalues.

对于那些被困在 SQL Server 2005 中并且不想或不能使用 udf 的人——尤其是在美国以外的地方——我已经采用了@Bobman 的方法并对其进行了概括。以下内容适用于美国、欧洲、新西兰和澳大利亚,但需要注意的是,并非所有澳大利亚州都遵守夏令时,即使是处于同一“基本”时区的州。添加尚不支持的 DST 规则也很容易,只需在@calculation值中添加一行即可。

-- =============================================
-- Author:      Herman Scheele
-- Create date: 20-08-2016
-- Description: Convert UTC datetime to local datetime
--              based on server time-distance from utc.
-- =============================================
create function dbo.UTCToLocalDatetime(@UTCDatetime datetime)
returns datetime as begin
    declare @LocalDatetime datetime, @DSTstart datetime, @DSTend datetime

    declare @calculation table (
        frm smallint,
        til smallint,
        since smallint,
        firstPossibleStart datetime,-- Put both of these with local non-DST time!
          firstPossibleEnd datetime -- (In Europe we turn back the clock from 3 AM to 2 AM, which means it happens 2 AM non-DST time)
    )

    insert into @calculation
    values
        (-9, -2, 1967, '1900-04-24 02:00', '1900-10-25 01:00'), -- USA first DST implementation
        (-9, -2, 1987, '1900-04-01 02:00', '1900-10-25 01:00'), -- USA first DST extension
        (-9, -2, 2007, '1900-03-08 02:00', '1900-11-01 01:00'), -- USA second DST extension
        (-1,  3, 1900, '1900-03-25 02:00', '1900-10-25 02:00'), -- Europe
        (9.5,11, 1971, '1900-10-01 02:00', '1900-04-01 02:00'), -- Australia (not all Aus states in this time-zone have DST though)
        (12, 13, 1974, '1900-09-24 02:00', '1900-04-01 02:00')  -- New Zealand

    select top 1    -- Determine if it is DST /right here, right now/ (regardless of input datetime)
        @DSTstart = dateadd(year, datepart(year, getdate())-1900, firstPossibleStart),          -- Grab first possible Start and End of DST period
        @DSTend   = dateadd(year, datepart(year, getdate())-1900, firstPossibleEnd),            
        @DSTstart = dateadd(day, 6 - (datepart(dw, @DSTstart) + @@datefirst - 2) % 7, @DSTstart),-- Shift Start and End of DST to first sunday
        @DSTend   = dateadd(day, 6 - (datepart(dw, @DSTend) + @@datefirst - 2) % 7, @DSTend),
        @LocalDatetime = dateadd(hour, datediff(hour, getutcdate(), getdate()), @UTCDatetime),  -- Add hours to current input datetime (including possible DST hour)
        @LocalDatetime = case
                when frm < til and getdate() >= @DSTstart and getdate() < @DSTend               -- If it is currently DST then we just erroneously added an hour above,
                  or frm > til and (getdate() >= @DSTstart or getdate() < @DSTend)              -- substract 1 hour to get input datetime in current non-DST timezone,
                    then dateadd(hour, -1, @LocalDatetime)                                      -- regardless of whether it is DST on the date of the input datetime
                else @LocalDatetime
            end
    from @calculation
    where datediff(minute, getutcdate(), getdate()) between frm * 60 and til * 60
      and datepart(year, getdate()) >= since
    order by since desc

    select top 1    -- Determine if it was/will be DST on the date of the input datetime in a similar fashion
        @DSTstart = dateadd(year, datepart(year, @LocalDatetime)-1900, firstPossibleStart),
        @DSTend   = dateadd(year, datepart(year, @LocalDatetime)-1900, firstPossibleEnd),
        @DSTstart = dateadd(day, 6 - (datepart(dw, @DSTstart) + @@datefirst - 2) % 7, @DSTstart),
        @DSTend   = dateadd(day, 6 - (datepart(dw, @DSTend) + @@datefirst - 2) % 7, @DSTend),
        @LocalDatetime = case
                when frm < til and @LocalDatetime >= @DSTstart and @LocalDatetime < @DSTend     -- If it would be DST on the date of the input datetime,
                  or frm > til and (@LocalDatetime >= @DSTstart or @LocalDatetime < @DSTend)    -- add this hour to the input datetime.
                    then dateadd(hour, 1, @LocalDatetime)
                else @LocalDatetime
            end
    from @calculation
    where datediff(minute, getutcdate(), getdate()) between frm * 60 and til * 60
      and datepart(year, @LocalDatetime) >= since
    order by since desc

    return @LocalDatetime
end

This function looks at the difference between local and utc time at the moment it runs to determine which DST-rules to apply. It then knows whether doing datediff(hour, getutcdate(), getdate())includes a DST hour or not and subtracts it if it does. Then it determines whether it was or will beDST at the date of the input UTC datetime and if so adds the DST hour back.

此函数会查看运行时本地时间和 UTC 时间之间的差异,以确定要应用哪些 DST 规则。然后它知道 do 是否datediff(hour, getutcdate(), getdate())包含 DST 小时,如果包含则减去它。然后它确定它在输入 UTC 日期时间的日期是否是或将是DST,如果是,则添加 DST 小时。

This comes with one quirk, which is that during the last hour of DST and the first hour of non-DST, the function has no way of determining which it is and assumes the latter. So regardless of input-datetime, if this codes runsduring the last hour of DST it will give the wrong outcome. Which means this works 99.9886% of the time.

这带来了一个怪癖,即在 DST 的最后一小时和非 DST 的第一小时,函数无法确定它是哪个,并假设后者。因此,无论输入日期时间如何,如果此代码在夏令时的最后一小时运行,它将给出错误的结果。这意味着这在 99.9886% 的时间内有效。

回答by Charles Burns

While the question's title mentions SQL Server 2005, the question is tagged with SQL Server in general. For SQL Server 2016 and later, you can use:

虽然问题的标题提到了 SQL Server 2005,但问题通常被标记为 SQL Server。对于 SQL Server 2016 及更高版本,您可以使用:

SELECT yourUtcDateTime AT TIME ZONE 'Mountain Standard Time'

A list of time zones is available with SELECT * FROM sys.time_zone_info

时区列表可用 SELECT * FROM sys.time_zone_info

回答by Gordon Glas

Bobman's answer is close, but has a couple bugs: 1) You must compare local DAYLIGHT time (instead of local STANDARD time) to the Daylight Saving End DateTime. 2) SQL BETWEEN is Inclusive so you should be comparing using ">= and <" instead of BETWEEN.

Bobman 的回答很接近,但有几个错误:1) 您必须将本地 DAYLIGHT 时间(而不是本地标准时间)与夏令时结束日期时间进行比较。2) SQL BETWEEN 是包含性的,因此您应该使用 ">= 和 <" 而不是 BETWEEN 进行比较。

Here is a working modified version along with some test cases: (Again, this only works for United States)

这是一个有效的修改版本以及一些测试用例:(同样,这仅适用于美国)

-- Test cases:
-- select dbo.fn_utc_to_est_date('2016-03-13 06:59:00.000') -- -> 2016-03-13 01:59:00.000 (Eastern Standard Time)
-- select dbo.fn_utc_to_est_date('2016-03-13 07:00:00.000') -- -> 2016-03-13 03:00:00.000 (Eastern Daylight Time)
-- select dbo.fn_utc_to_est_date('2016-11-06 05:59:00.000') -- -> 2016-11-06 01:59:00.000 (Eastern Daylight Time)
-- select dbo.fn_utc_to_est_date('2016-11-06 06:00:00.000') -- -> 2016-11-06 01:00:00.000 (Eastern Standard Time)
CREATE FUNCTION [dbo].[fn_utc_to_est_date]
(
    @utc datetime
)
RETURNS datetime
as
begin
    -- set offset in standard time (WITHOUT daylight saving time)
    declare @offset smallint
    set @offset = -5  --EST

    declare @localStandardTime datetime
    SET @localStandardTime = dateadd(hh, @offset, @utc)

    -- DST in USA starts on the second sunday of march and ends on the first sunday of november.
    -- DST was extended beginning in 2007:
    --   https://en.wikipedia.org/wiki/Daylight_saving_time_in_the_United_States#Second_extension_.282005.29
    -- If laws/rules change, obviously the below code needs to be updated.

    declare @dstStartDate datetime,
            @dstEndDate datetime,
            @year int
    set @year = datepart(year, @localStandardTime)

    -- get the first possible DST start day
    if (@year > 2006) set @dstStartDate = cast(@year as char(4)) + '-03-08 02:00:00'
    else              set @dstStartDate = cast(@year as char(4)) + '-04-01 02:00:00'
    while ((datepart(weekday,@dstStartDate) != 1)) begin --while not sunday
        set @dstStartDate = dateadd(day, 1, @dstStartDate)
    end

    -- get the first possible DST end day
    if (@year > 2006) set @dstEndDate = cast(@year as char(4)) + '-11-01 02:00:00'
    else              set @dstEndDate = cast(@year as char(4)) + '-10-25 02:00:00'
    while ((datepart(weekday,@dstEndDate) != 1)) begin --while not sunday
        set @dstEndDate = dateadd(day, 1, @dstEndDate)
    end

    declare @localTimeFinal datetime,
            @localTimeCompare datetime
    -- if local date is same day as @dstEndDate day,
    -- we must compare the local DAYLIGHT time to the @dstEndDate (otherwise we compare using local STANDARD time).
    -- See: http://www.timeanddate.com/time/change/usa?year=2016
    if (datepart(month,@localStandardTime) = datepart(month,@dstEndDate)
            and datepart(day,@localStandardTime) = datepart(day,@dstEndDate)) begin
        set @localTimeCompare = dateadd(hour, 1, @localStandardTime)
    end
    else begin
        set @localTimeCompare = @localStandardTime
    end

    set @localTimeFinal = @localStandardTime

    -- check for DST
    if (@localTimeCompare >= @dstStartDate and @localTimeCompare < @dstEndDate) begin
        set @localTimeFinal = dateadd(hour, 1, @localTimeFinal)
    end

    return @localTimeFinal
end

回答by amber

I recently had to do the same thing. The trick is figuring out the offset from UTC, but it's not a hard trick. You simply use DateDiff to get the difference in hours between local and UTC. I wrote a function to take care of this.

我最近不得不做同样的事情。诀窍是计算出 UTC 的偏移量,但这不是一个难的技巧。您只需使用 DateDiff 来获取本地和 UTC 之间的小时差。我写了一个函数来处理这个问题。

Create Function ConvertUtcDateTimeToLocal(@utcDateTime DateTime)
Returns DateTime
Begin
    Declare @utcNow DateTime
    Declare @localNow DateTime
    Declare @timeOffSet Int

    -- Figure out the time difference between UTC and Local time
    Set @utcNow = GetUtcDate()
    Set @localNow = GetDate()
    Set @timeOffSet = DateDiff(hh, @utcNow, @localNow) 

    DECLARE @localTime datetime 

    Set @localTime = DateAdd(hh, @timeOffset, @utcDateTime) 

    -- Check Results
    return @localTime 

End
GO

This does have on crucial short coming: If a time zone uses a fractional offset, such as Nepal which is GMT+5:45, this will fail because this only deals with whole hours. However, it should fit your needs just fine.

这确实有一个关键的缺点:如果一个时区使用小数偏移量,例如尼泊尔是 GMT+5:45,这将失败,因为它只处理整小时。但是,它应该很好地满足您的需求。