How can I convert a datetime array from english to spanish format?
11 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I have this datetime array :
'27-Dec-2019'
'03-Jan-2020'
'10-Jan-2020'
'17-Jan-2020'
'24-Jan-2020'
'31-Jan-2020'
'07-Feb-2020'
'14-Feb-2020'
'21-Feb-2020'
I want to convert english months in spanish months. For example "Jan" will be "Ene" and "Dec" will be "Dic". Thus, I want a datetime array like below:
'27-Dic-2019'
'03-Ene-2020'
'10-Ene-2020'
'17-Ene-2020'
'24-Ene-2020'
'31-Ene-2020'
'07-Feb-2020'
'14-Feb-2020'
'21-Feb-2020'
How can I do it? Thanks to all!
0 件のコメント
回答 (1 件)
MJFcoNaN
2022 年 4 月 7 日
The "Command Window Preferences" controls default locale and date settings.
However, if you only need output some strings, try this kind of code:
string(datetime(2020,12,2), "dd-MMM-yyyy", "es_ES")
2 件のコメント
MJFcoNaN
2022 年 4 月 8 日
The "Preferences----Command Window Preferences----Format of date and time" controls default locale and date settings.
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!