datetime Invalid Parameter for TimeZone
显示 更早的评论
Hi,
I need to convert a timestamp to GMT which depends on the TimeZone. This is read out of a variable which was in this case 'Europe/Berlin'. The timestamp has to be sent as a request in GMT time and will be sent back (both as posixtime). The backtransformation from posixtime to the timezone read out of the variable is working:
datetime(1565618481,'TimeZone','Europe/Berlin','ConvertFrom','posixtime',"TicksPerSecond",1000,'Format','dd-MMM-yyyy HH:mm:ss.SSS Z')
For the request I wanted to define a datetime vektor of the local time with the timezone and convert it then to GMT to make the posixtime vektor afterwards. In the following code the same timezone was not working:
datetime('22.07.2019 21:00:00','InputFormat','TimeZone','Europe/Berlin','dd.MM.yyyy HH:mm:ss Z')
I always get the Error:
Error using datetime (line 538)
Invalid parameter name: Europe/Berlin.
Can anyone help me why this is the case and how I can make it work?
Thank you,
Manuel
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!