回复:Salesforce Apex:日期
不断收到此错误消息。
编译错误:变量不存在:你好 线路:6
public with sharing class Solution {
private String dateAsString = '2019-01-01 00:00:00';
public Integer getDay(Date someDate) {
Date hello = Date.newInstance(2024, 7, 11);
return hello;
}
}
不要将你的类命名为
Solution
,这是标准对象的名称。就像public Integer Account = 5; // happy debugging suckers
在尝试部署之前,您确定文件已保存(在您的磁盘上)正常吗?我越来越
Illegal conversion from Date to Integer (6:7)
但是如果我将该行更改为
return hello.day();
它可以编译正常。