脚本中的函数运行时的时间戳

时间:2017-03-22 02:00:04

标签: scripting google-sheets timestamp cell

这与其他问题不同,人们在更新其他单元格时,正在尝试使用时间戳更新Google工作表中的单元格。

此问题是关于如何在脚本中运行功能时在Google表格单元格中获取时间戳。

那么,如何更新我的工作表中的单元格,并更新了我的脚本中的函数上次运行的时间戳?

有意义吗?

1 个答案:

答案 0 :(得分:0)

您可以创建一个处理时间戳的函数,并从脚本函数中调用此函数。像

这样的东西
#carousel {
    margin:40px 20px;
    overflow:hidden;
    padding:0;
    position:relative;
    width:auto;
}

/* navigation items */
#carousel .navigation {
    background:rgba(0,0,0,0.3);
    color:rgba(255,255,255,0.8);
    display:block;
    font-size:3em;
    margin-top:6.2em;
    position:absolute;
    text-align:center;
    text-shadow:rgba(0,0,0,0.1); 0 0 2px;
    width:50px;
    -moz-transition:all 0.4s;
    -ms-transition:all 0.4s;
    -webkit-transition:all 0.4s;
    -o-transition:all 0.4s;
    transition:all 0.4s;
    text-decoration: none;
}

#carousel:hover .navigation {
    background:rgba(0,0,0,0.3);
    color:rgba(255,255,255,0.8);
    text-shadow:rgba(0,0,0,0.7); 0 0 2px;
}

#carousel .navigation:hover {
    background:rgba(0,0,0,0.5);
}

#carousel .previous {
    left:0;
}

#carousel .next {
    right:0;
}

/* carousel container */
#carousel ul {
    -moz-box-orient:horizontal;
    -ms-box-orient:horizontal;
    -webkit-box-orient:horizontal;
    -o-box-orient:horizontal;
    box-orient:horizontal;

    display:-moz-box;
    display:-ms-box;
    display:-webkit-box;
    display:-o-box;
    display:box;

    list-style-type:none;
    margin:5px;
    margin-left:-200px;
    padding:0;
}

/* standard width and height for the carousel items */
#carousel li {
    height:550px;
    margin-right:10px;
    width:300px;
    -webkit-filter: grayscale(90%); /* Safari 6.0 - 9.0 */
    filter: grayscale(90%);
}

/* animation properties for the carousel */
.animate ul {
    -moz-transition:margin 0.5s;
    -ms-transition:margin 0.5s;
    -webkit-transition:margin 0.5s;
    -o-transition:margin 0.5s;
    transition:margin 0.5s;
}

/* different color for each of our items */

#carousel li:nth-child(1) { /* Architecture */

}

#carousel li:nth-child(2) { /* SPS Jeddah */
    background-image: url('../imgs/cover/sps.jpg');
    background-size: cover;
    background-repeat: no-repeat;

}

#carousel li:nth-child(3) { /* Steak House */
    background-image: url('../imgs/cover/STH%20Restaurant.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(4) { /* Sari Street Business Units */
    background-image: url('../imgs/cover/SariStreetBusinessUnits.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(5) { /* SPS Riyadh */
    background-image: url('../imgs/cover/spsriyadh.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(6) { /* Madina Road */
    background-image: url('../imgs/cover/madinahroadofficepark.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(7) { /* Echole */
    background-image: url('../imgs/cover/ecolefrancaise.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(8) { /* Khaldiyyah */
    background-image: url('../imgs/cover/khaldeyyahbusinessunits.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(9) { /* Inmaeiya sales center */
    background-image: url('../imgs/cover/inmaeya.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(10) { /* Al-Rabwah Apartments */
    background-image: url('../imgs/cover/tarabzoni.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(11) { /* Wesal */
    background-image: url('../imgs/cover/wesal.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(12) { /* Interior */

}

#carousel li:nth-child(13) { /* Wakame */
    background-image: url('../imgs/cover/wakame.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(14) { /* MTS */
    background-image: url('../imgs/cover/mts.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(15) { /* Hamza */
    background-image: url('../imgs/cover/hamza.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(16) { /* Meraki */
    background-image: url('../imgs/cover/meraki.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(17) { /* Tarhati */
    background-image: url('../imgs/cover/tarhati.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(18) { /* Baytoti */
    background-image: url('../imgs/cover/baytoti.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}
#carousel li:nth-child(19) { /* Micro Architecture */

}

#carousel li:nth-child(20) { /* Hafiz */
    background-image: url('../imgs/cover/hafiz.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(21) { /* Muhaideb */
    background-image: url('../imgs/cover/mts.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(22) { /* Graphic Identities */

}

#carousel li:nth-child(23) { /* MHS */
    background-image: url('../imgs/cover/shukri.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(24) { /* BQ CI */
    background-image: url('../imgs/cover/bq.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(25) { /* Meraki CI */
    background-image: url('../imgs/cover/meraki2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(26) { /* Wayfinding */

}

#carousel li:nth-child(27) { /* BQ Office */
    background-image: url('../imgs/cover/bq2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

#carousel li:nth-child(28) { /* TA-Schools */
    background-image: url('../imgs/cover/tas.jpg');
    background-size: cover;
    background-repeat: no-repeat;
}

更改工作表名称和范围以适应。 注意:如果您使用的是非容器绑定的脚本,请将SpreadsheetApp.getActive()更改为SpreadsheetApp.openById(),并将电子表格的ID作为参数提供。