Parse.com month issue
Parse.com month issue
在google电子表格单元格中我有这个日期25/07/2005。我也把它作为我的appscript的一部分在google spreadsheet
if (cellDataString.substring(2,3) === '/' && cellDataString.substring(5,6) === '/') {
var year = cellDataString.substring(6,10);
var month = cellDataString.substring(3,5);
var day = cellDataString.substring(0,2);
var formatedDate = Utilities.formatDate(new Date(year, month, day) , "GMT+0530", "yyyy-MM-dd'T'HH:mm:ss'Z'");
var requiredData = {
"__type": "Date",
"iso": formatedDate
}
Logger.log(requiredData);
cellData = requiredData;
}
但是当我运行这个脚本并上传数据到parse.com时,一个月增加到所需的月份,而不是25/07/2005(2005年7月27日),我得到2005年8月27日(27/08/2005)。除了使用"month - 1",还有其他正确的方法来上传正确的日期吗?
JavaScript日期使用从0到11的月份。试着将代码的第3行替换为:
var month = cellDataString.substring(3,5) - 1;
相关文章:
- issue with FB.Event.subscribe
- 如何将日期字符串视为格式化数组[EYEAR,MONTH,DAY]
- 使用Jquery Issue垂直重新排序Divs
- 创建了一个选项卡,但点击时不会起作用-jQuery issue/newbie
- jQuery find() Issue
- $route.reload(); Issue
- PHP json_encode issue
- Three.js issue creating meshes outside of loader's load(
- Jquery :gt(value) issue
- pickaday maxDate issue
- Stage.load(json) Issue..Kinetic.js
- Mootools Selector issue
- Java 8 Update 91 Issue
- 浮动图-如何在x轴上显示第一个月和最后一个月的minTickSize:[2,“month&”]
- JS parseInt() issue
- Jquery Colorbox issue with firefox
- Javascript firefox issue
- JavaScript Getters and Setters issue
- javascript and css firefox issue
- Parse.com month issue