How do I get local system format (like dd-mm-yyyy or mm/dd/yyyy) in matlab ?
1 次查看(过去 30 天)
显示 更早的评论
df = 'mm/dd/yyyy';datestr(datenum(today),df)
0 个评论
回答(1 个)
Walter Roberson
2017-1-19
datestr(today, 'local')
Or is the question to find out what the system format is ?
3 个评论
Walter Roberson
2017-1-19
It appears the relevant MS Windows API call are: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319114(v=vs.85).aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/dd318131(v=vs.85).aspx
To avoid having to write some C++ code to retrieve the information, it is plausible that you might be able to find a Java method for this, or an ActiveX method. This is some sample VBS code at http://www.vb-helper.com/howto_format_time.html
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ActiveX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!