A | B | C | D | E | F | |
---|---|---|---|---|---|---|
1 | 12/7/2017 14:24 | |||||
2 | ||||||
3 | ||||||
4 | ||||||
5 | test | |||||
6 | test | Question - why is FUS1 showing as GMT+2 for me? Aren't you GMT+1? | Yes but the test date is in july, so it is summer time > GMT+2 If you change to a date in winter you'll see FUS1 = gmt+1 I added FUS1 and the logger value in the UI to make it more easy to check. | |||
7 | ||||||
8 | ||||||
9 | ||||||
10 | if the button doesn't work, please refresh your browser, you should get an authorization request for spreadsheet service. The sheet is public read and write. | |||||
11 | ||||||
12 | ||||||
13 | this is the code : | |||||
14 | function myFunction() { | |||||
15 | var ss= SpreadsheetApp.getActiveSheet(); | |||||
16 | var testDate = ss.getRange(1,1).getValue(); | |||||
17 | Logger.log(testDate); | |||||
18 | var FUS1=new Date(testDate).toString().substr(25,6)+":00"; | test | ||||
19 | var app=UiApp.createApplication().setWidth('700').setHeight('150').setTitle('time check'); | |||||
20 | var label1 = app.createLabel().setText('raw value = '+testDate); | |||||
21 | var label2 = app.createLabel().setText('formated value = '+ Utilities.formatDate(testDate, FUS1, 'MM/dd/yyyy - HH:mm:ss')+' (FUS1 = '+FUS1+')'); | |||||
22 | var label3 = app.createLabel().setText('LOG value logged on '+Logger.getLog()); | |||||
23 | var grid = app.createGrid(5,1) | |||||
24 | grid.setWidget(0, 0,label1).setWidget(2, 0,label2).setWidget(4, 0,label3); | |||||
25 | app.add(grid); | |||||
26 | SpreadsheetApp.getActive().show(app); | |||||
27 | Logger.clear() | |||||
28 | } | |||||
29 | ||||||
30 |