例外:
引起:java.lang.IllegalArgumentException:无法识别日期时间区域ID"America/New_York"
Android代码:
DateTime dt = new DateTime();
DateTimeZone dtZone = DateTimeZone.forID("America/New_York");
DateTime dtus = dt.withZone(dtZone);
Date dateInUS = dtus.toDate();
System.out.println(dateInUS);
Run Code Online (Sandbox Code Playgroud)
为什么我收到此错误?
我在Gradle中加载了Joda API:
compile 'net.danlew:android.joda:2.7.1'
Run Code Online (Sandbox Code Playgroud) 当我的React应用程序失败时,我只能看到引用bundle.js文件的错误,而不是生成它的原始组件,因此我不可能知道哪一行是生成此错误的源代码行:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@date-io/dayjs": "^2.16.0",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@fontsource/roboto": "^4.5.8",
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.10",
"@mui/x-date-pickers": "^5.0.5",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"dayjs": "^1.11.6",
"formik": "^2.2.9",
"moment": "^2.29.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": …Run Code Online (Sandbox Code Playgroud)