Crystal reports 在Crystal Reports中将服务器时区转换为本地时区

Crystal reports 在Crystal Reports中将服务器时区转换为本地时区,crystal-reports,timezone,utc,Crystal Reports,Timezone,Utc,我有一个时间域。ClockInTime,在Epicor服务器中,我使用的ERP与我的本地时间相差1小时。我的本地时区是UTC都柏林、爱丁堡、里斯本、伦敦。我不知道如何将Epicor服务器时区转换为本地时区 我试过这个代码,但不起作用 ShiftDateTime cdate{BAQReportResult.Labrohed.ClockInTime},UTC,0, 我做错了什么?如果是打印字段,请增加公式中的小时数。否则,将使用当前用户时区: ShiftDateTime ( CurrentDate

我有一个时间域。ClockInTime,在Epicor服务器中,我使用的ERP与我的本地时间相差1小时。我的本地时区是UTC都柏林、爱丁堡、里斯本、伦敦。我不知道如何将Epicor服务器时区转换为本地时区

我试过这个代码,但不起作用

ShiftDateTime cdate{BAQReportResult.Labrohed.ClockInTime},UTC,0,


我做错了什么?

如果是打印字段,请增加公式中的小时数。否则,将使用当前用户时区:

ShiftDateTime ( CurrentDateTime, PrintTimeZone, CurrentCEUserTimeZone)
要强制实施时区(如英国夏季时间),请使用以下命令:

ShiftDateTime (cdate({BAQReportResult.LaborHed.ClockInTime}),"UTC,0, BST", "")
请参阅Crystal Reports联机帮助中的ShiftDateTime参考 Epicor服务器我使用的ERP与我的本地时间相差1小时。我的本地时区是UTC都柏林、爱丁堡、里斯本、伦敦

我做错了什么

您需要输入服务器时区

看起来好像ShiftDateTime cdate{BAQReportResult.LaborHed.ClockInTime},UTC,0输入并输出本地时间

如何将Epicor服务器时区转换为我的本地时区

因为您的本地时间是UTC/伦敦,所以我假设服务器时间是UTC+1。inputTimeZone和newTimeZone的Crystal Reports语法为std,偏移量

std=标准时区的字符串名称。 偏移量=标准时区西部的偏移量(以分钟为单位)为正。 试试这个:

或者像这样显式地写本地时区:

ShiftDateTime (inputDateTime, inputTimeZone, newTimeZone)
ShiftDateTime (cdate({BAQReportResult.LaborHed.ClockInTime}), "UTC,-60", "") 
ShiftDateTime (cdate({BAQReportResult.LaborHed.ClockInTime}), "UTC,-60", "UTC,0")