英文:
convert time to based on each timezone in KDB+
问题
timeStamp | timeZone | localTime |
---|---|---|
2022.10.06D08:56:00.508000000 | "Europe/London" | localTime to London |
2022.10.06D08:56:00.508000000 | "Australia/Sydney" | localTime to Sydney |
2022.10.06D08:56:00.508000000 | "America/New York" | localTime to New York |
你可以使用以下代码将每个时区的时间戳转换为本地时间:
update localTime:{first (dxTZFromGMT[`$y;timeStamp])} each timeZone from table
请注意,这只能将时间戳转换为单个时区的本地时间。
英文:
timeStamp | timeZone | localTime |
---|---|---|
2022.10.06D08:56:00.508000000 | "Europe/London" | localTime to London |
2022.10.06D08:56:00.508000000 | "Australia/Sydney" | localTime to sydney |
2022.10.06D08:56:00.508000000 | "America/New York" | localTime to new york |
I want to convert timeStamp of each timeZone to its local time.
update localTime:{first (dxTZFromGMT[`$y;timeStamp])} each timeZone from table
I am able to convert to only single timeZone
update localTime:{first (dxTZFromGMT[`$"Australia/Sydney";x])} each timeStamp from table
答案1
得分: 2
update localTime:first each dxTimeZone`$timeZone; timestamp from table
'
form of each https://code.kx.com/q/ref/maps/#each
{show (x;y)}'[1 2 3;4 5 6]
1 4
2 5
3 6
英文:
update localTime:first each dxTimeZone'[`$timeZone; timestamp] from table
'
form of each https://code.kx.com/q/ref/maps/#each
{show (x;y)}'[1 2 3;4 5 6]
1 4
2 5
3 6
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论